Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Handles the login event
- */
- private fun handleLogin() {
- val username = loginform_username.getContent()
- val password = loginform_password.getContent()
- Log.d(TAG, "handleLogin - username = $username, password = $password")
- /**
- * This is very "identityManager" specific code, so we check for the various
- * bits of support. The "Mock" version will just
- */
- when (identityManager) {
- is MockIdentityManager -> {
- Log.i(TAG, "Invoking Mock User Authentication")
- val user = User()
- user.username = username
- userIsAuthenticated(user)
- }
- is AWSIdentityManager -> {
- Log.i(TAG, "Invoking Amazon Cognito User Authentication")
- thread(start = true) {
- val cognitoUser = (identityManager as AWSIdentityManager).userPool.currentUser
- cognitoUser.getSession(this)
- }
- }
- else -> {
- throw RuntimeException("Unknown IdentityManager implementation")
- }
- }
- }
Add Comment
Please, Sign In to add comment