linkOrCreateUser

context(_: JdbcTransaction, _: Raise<Issue>)
fun linkOrCreateUser(provider: String, providerUserId: String, preferredUsername: String, email: String, currentPrincipal: Principal? = null): UserEntity

Links a new OAuth account to an existing user or creates a new user.

Return

The UserEntity for the user.

Parameters

provider

The name of the OAuth provider.

providerUserId

The unique ID from the provider.

preferredUsername

The username the user wants to use.

email

The email address of the user.

currentPrincipal

The currently authenticated principal, if any.