({
apiURI,
appId,
email,
code,
refreshToken,
}: SharedInput & VerifyMagicCodeParams)
| 37 | * and support `extraFields`. |
| 38 | */ |
| 39 | export async function verifyMagicCode({ |
| 40 | apiURI, |
| 41 | appId, |
| 42 | email, |
| 43 | code, |
| 44 | refreshToken, |
| 45 | }: SharedInput & VerifyMagicCodeParams): Promise<VerifyResponse> { |
| 46 | const res = await jsonFetch(`${apiURI}/runtime/auth/verify_magic_code`, { |
| 47 | method: 'POST', |
| 48 | headers: { 'content-type': 'application/json' }, |
| 49 | body: JSON.stringify({ |
| 50 | 'app-id': appId, |
| 51 | email, |
| 52 | code, |
| 53 | ...(refreshToken ? { 'refresh-token': refreshToken } : {}), |
| 54 | }), |
| 55 | }); |
| 56 | return res; |
| 57 | } |
| 58 | |
| 59 | export type CheckMagicCodeParams = { |
| 60 | email: string; |
nothing calls this directly
no test coverage detected