signUpWith

abstract suspend fun <C, R, Provider : AuthProvider<C, R>> signUpWith(provider: Provider, redirectUrl: String? = defaultRedirectUrl(), config: C.() -> Unit? = null): R?(source)

Signs up a new user with the specified provider

Example:

val result = auth.signUpWith(Email) {
email = "example@email.com"
password = "password"
}

or

auth.signUpWith(Google) // Opens the browser to login with google

Return

The result of the sign-up (e.g. the user id) or null if auto-confirm is enabled (resulting in a login)

Parameters

provider

the provider to use for signing up. E.g. Email, Phone or Google

redirectUrl

The redirect url to use. If you don't specify this, the platform specific will be used, like deeplinks on android.

config

The configuration to use for the sign-up.

Throws

or one of its subclasses if receiving an error response. If the error response contains a error code, an AuthRestException will be thrown which can be used to easier identify the problem.

HttpRequestTimeoutException

if the request timed out

on network related issues

if using the Email or Phone provider and the password is too weak. You can get the reasons via AuthWeakPasswordException.reasons