Skip to content
Migrating from NextAuth.js v4? Read our migration guide.

client

SignInResponse

Properties

code

code: undefined | string;

error

error: undefined | string;

ok

ok: boolean;

status

status: number;

url

url: null | string;

SignInAuthorizationParams

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

Match inputType of new URLSearchParams(inputType)


signIn()

signIn(provider, options, authorizationParams)

signIn(
   provider?, 
   options?, 
authorizationParams?): Promise<void>

Initiates a signin flow or sends the user to the signin page listing all possible providers. Handles CSRF protection.

Parameters

ParameterType
provider?ProviderId
options?SignInOptions<true>
authorizationParams?SignInAuthorizationParams

Returns

Promise<void>

Note

This method can only be used from Client Components (“use client” or Pages Router). For Server Actions, use the signIn method imported from the auth config.

signIn(provider, options, authorizationParams)

signIn(
   provider?, 
   options?, 
authorizationParams?): Promise<SignInResponse>

Parameters

ParameterType
provider?ProviderId
options?SignInOptions<false>
authorizationParams?SignInAuthorizationParams

Returns

Promise<SignInResponse>


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/solid-start/client"
signOut()

Parameters

ParameterType
options?SignOutParams<true>

Returns

Promise<void>

Auth.js © Balázs Orbán and Team - 2024