client
SignInOptions
Extends
Record
<string
,unknown
>
Properties
callbackUrl?
optional callbackUrl: string;
Specify to which URL the user will be redirected after signing in. Defaults to the page URL the sign-in is initiated from.
redirect?
optional redirect: boolean;
SignOutParams<R>
Type parameters
Type parameter | Value |
---|---|
R extends boolean | true |
Properties
callbackUrl?
optional callbackUrl: string;
redirect?
optional redirect: R;
[Documentation](https://next-auth.js.org/getting-started/client#using-the-redirect-false-option-1
LiteralUnion<T, U>
type LiteralUnion<T, U>: T | U & Record<never, never>;
Type parameters
Type parameter | Value |
---|---|
T extends U | - |
U | string |
SignInAuthorizationParams
type SignInAuthorizationParams: string | string[][] | Record<string, string> | URLSearchParams;
Match inputType
of new URLSearchParams(inputType)
signIn()
signIn<P>(
providerId?,
options?,
authorizationParams?): Promise<undefined | Response>
Client-side method to initiate a signin flow or send the user to the signin page listing all possible providers. Automatically adds the CSRF token to the request.
import { signIn } from "@auth/astro/client"
signIn()
signIn("provider") // example: signIn("github")
Type parameters
Type parameter | Value |
---|---|
P extends undefined | RedirectableProviderType | undefined |
Parameters
Parameter | Type |
---|---|
providerId ? | LiteralUnion <P extends RedirectableProviderType ? P | BuiltInProviderType : BuiltInProviderType , string > |
options ? | SignInOptions |
authorizationParams ? | SignInAuthorizationParams |
Returns
signOut()
signOut(options?): Promise<void>
Signs the user out, by removing the session cookie. Automatically adds the CSRF token to the request.
import { signOut } from "@auth/astro/client"
signOut()
Parameters
Parameter | Type |
---|---|
options ? | SignOutParams <true > |
Returns
Promise
<void
>