Skip to main content

loginWithPasswordMutation

loginWithPasswordMutation(variables, init?): Promise<TypedResponse<Response>>

Low-level function for making a loginWithPasswordMutation request.

Parameters

variables: Variables

init?: RequestInit

Returns

Promise<TypedResponse<Response>>

Remarks

There are many things that can go wrong with this request and Khan Academy doesn't provide a great way to handle them. It's recommended to use Client.login instead.

Reference

See

Client.login

Example

Simple usage without error handling:

const response = await mutations.loginWithPasswordMutation({
identifier: 'username', // or email
password: 'password',
})

const cookies = response.headers.get('set-cookie')

Source

src/mutations/loginWithPasswordMutation.ts:90