MCPcopy Create free account
hub / github.com/instantdb/instant / verifyMagicCode

Function verifyMagicCode

client/packages/core/src/authAPI.ts:39–57  ·  view source on GitHub ↗
({
  apiURI,
  appId,
  email,
  code,
  refreshToken,
}: SharedInput & VerifyMagicCodeParams)

Source from the content-addressed store, hash-verified

37 * and support `extraFields`.
38 */
39export 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
59export type CheckMagicCodeParams = {
60 email: string;

Callers

nothing calls this directly

Calls 1

jsonFetchFunction · 0.50

Tested by

no test coverage detected