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

Function checkMagicCode

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

Source from the content-addressed store, hash-verified

67 created: boolean;
68};
69export async function checkMagicCode({
70 apiURI,
71 appId,
72 email,
73 code,
74 refreshToken,
75 extraFields,
76}: SharedInput & CheckMagicCodeParams): Promise<CheckMagicCodeResponse> {
77 const res = await jsonFetch(`${apiURI}/runtime/auth/verify_magic_code`, {
78 method: 'POST',
79 headers: { 'content-type': 'application/json' },
80 body: JSON.stringify({
81 'app-id': appId,
82 email,
83 code,
84 ...(refreshToken ? { 'refresh-token': refreshToken } : {}),
85 ...(extraFields ? { 'extra-fields': extraFields } : {}),
86 }),
87 });
88 return res;
89}
90
91export type VerifyRefreshTokenParams = { refreshToken: string };
92export async function verifyRefreshToken({

Callers

nothing calls this directly

Calls 1

jsonFetchFunction · 0.50

Tested by

no test coverage detected