Created
May 31, 2020 04:56
-
-
Save chelseatroy/f6b75a572a60960a35b6d848b4cecad7 to your computer and use it in GitHub Desktop.
Save Session Data Upon Successful Login
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LoginActivity : AppCompatActivity() { | |
... | |
fun authenticate() { | |
... | |
if (session?.token != null) { | |
//HERE'S WHERE WE SAVE THE SESSION DAA | |
saveSessionData(session!!.name, session!!.token) | |
startActivity(Intent(this@LoginActivity, MainActivity::class.java)) | |
} else { | |
deliverAuthFailureMessage() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment