Skip to content
需要从 NextAuth.js v4 升级到最新版本吗?请查阅 版本升级指南

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>