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

Method check_magic_code

client/packages/python/src/instantdb/_sync/auth.py:34–49  ·  view source on GitHub ↗
(
        self,
        *,
        email: str,
        code: str,
        extra_fields: dict[str, Any] | None = None,
    )

Source from the content-addressed store, hash-verified

32 return result["code"]
33
34 def check_magic_code(
35 self,
36 *,
37 email: str,
38 code: str,
39 extra_fields: dict[str, Any] | None = None,
40 ) -> tuple[dict[str, Any], bool]:
41 body: dict[str, Any] = {"email": email, "code": code}
42 if extra_fields is not None:
43 body["extra-fields"] = extra_fields
44 result = self._http.post(
45 "/admin/verify_magic_code",
46 params={"app_id": self._app_id},
47 json=body,
48 )
49 return result["user"], result["created"]
50
51 def create_token(self, *, email: str | None = None, id: str | None = None) -> str:
52 body = _exactly_one({"email": email, "id": id})

Calls 1

postMethod · 0.45

Tested by 2