Skip to content

Instantly share code, notes, and snippets.

@adrianhall
Created September 4, 2018 17:25
Show Gist options
  • Save adrianhall/7c582e34546ce805671c93e83deb52e5 to your computer and use it in GitHub Desktop.
Save adrianhall/7c582e34546ce805671c93e83deb52e5 to your computer and use it in GitHub Desktop.
/**
* Record a successful authentication
*
* @param username the username of the user that was authenticated
*/
override fun recordSuccessfulLogin(username: String) {
// Update the endpoint profile to include the username
val profile = pinpoint.targetingClient.currentEndpoint()
profile.user.userId = username
pinpoint.targetingClient.updateEndpointProfile(profile)
// Record the sign in
recordEvent("_userauth.sign_in")
}
/**
* Record a failed authentication
*/
override fun recordFailedLogin() {
recordEvent("_userauth.authfail")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment