social-common / pragma.account / AccountPlugin /

AccountPlugin #

interface AccountPlugin

Plugin for account lifecycle events like creation, deletion and login

Functions #

NameSummary

onAccountCreate

abstract suspend fun onAccountCreate(idProviderAccount: IdProviderAccount): PragmaAccount

Called just before an account is created but after they have completed the initial authentication using the IdentityProvider. This can be used to block account creation by throwing PragmaError.AccountService_Unauthorized. This can also be used to set the user’s displayName, tags, and the groups they belong to.

onAccountCreated

abstract suspend fun onAccountCreated(pragmaAccount: PragmaAccount)

Called after an account is created. Use this to make any desired updates to the user’s account.

onAccountDelete

abstract suspend fun onAccountDelete(pragmaAccount: PragmaAccount)

Called before an account is deleted. Use this to perform any actions just before a user is deleted.

onAccountDeleted

abstract suspend fun onAccountDeleted(pragmaAccount: PragmaAccount)

Called after an account is deleted Any updates to the PragmaAccount will not be persisted because the account has been removed.

onAccountLogin

abstract suspend fun onAccountLogin(pragmaAccount: PragmaAccount)

Called when an account is authenticated. Use this to make any desired updates to the user’s account. Or to block login by throwing PragmaError.AccountService_Unauthorized.

onAccountUpdate

abstract suspend fun onAccountUpdate(pragmaAccount: PragmaAccount)

Called when an account is updated. Use this to make any desired updates to the user’s account.