Skip to main content

client

signIn()​

signIn<P>(providerId?, options?, authorizationParams?): Promise< 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​

β–ͺ P extends RedirectableProviderType = undefined

Parameters​

β–ͺ providerId?: LiteralUnion< P extends RedirectableProviderType ? P | BuiltInProviderType : BuiltInProviderType, string >

β–ͺ options?: SignInOptions

β–ͺ authorizationParams?: SignInAuthorizationParams

Returns​

Promise< Response >


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​

β–ͺ options?: SignOutParams< true >

Returns​

Promise< void >


SignInAuthorizationParams​

SignInAuthorizationParams: string | string[][] | Record< string, string > | URLSearchParams

Match inputType of new URLSearchParams(inputType)