public SignUpResponse signUp ( SignUpCredentials loginCreds ) { logger . debug ( "signUp(" + loginCreds + ")" ) ; try { setLoginState ( LOGGING_IN ) ; PublicKey key = Crypto . pubKeyFromBytes ( getWebService ( ) . getPublicKey ( ) ) ; loginCreds . encryptPassword ( key ) ; logger . debug ( "Login Creds: " + loginCreds ) ; ServerResponse < ValidCredentials > response = ServerResponse . from ( ValidCredentials . class , getWebService ( ) . userSignUp ( loginCreds ) ) ; logger . debug ( "Response: " + response . getStatus ( ) ) ; BackendUser user ; if ( response . getStatus ( ) . isSuccess ( ) ) { user = setUser ( response . get ( ) ) ; } else { return new SignUpResponse ( null , Status . SERVER_ERROR_INTERNAL , " null user returned" ) ; } return new SignUpResponse ( user , response . getStatus ( ) , response . getError ( ) ) ; } catch ( Exception e ) { logger . error ( "SignUp Failure(" + loginCreds . getEmailAddress ( ) + ")" , e ) ; return new SignUpResponse ( null , Status . SERVER_ERROR_INTERNAL , e . getLocalizedMessage ( ) ) ; } }
Syncronously attempt to create user account