Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit ccb2173

Browse files
authored
Merge pull request #328 from supabase-community/feat/add-verify-token-hash
fix: add verify token hash
2 parents cb6abab + 82a04aa commit ccb2173

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

gotrue/types.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
"zoom",
4242
]
4343

44+
EmailOtpType = Literal[
45+
"signup", "invite", "magiclink", "recovery", "email_change", "email"
46+
]
47+
4448
AuthChangeEventMFA = Literal["MFA_CHALLENGE_VERIFIED"]
4549

4650
AuthChangeEvent = Literal[
@@ -325,13 +329,7 @@ class VerifyOtpParamsOptions(TypedDict):
325329
class VerifyEmailOtpParams(TypedDict):
326330
email: str
327331
token: str
328-
type: Literal[
329-
"signup",
330-
"invite",
331-
"magiclink",
332-
"recovery",
333-
"email_change",
334-
]
332+
type: EmailOtpType
335333
options: NotRequired[VerifyOtpParamsOptions]
336334

337335

@@ -345,9 +343,14 @@ class VerifyMobileOtpParams(TypedDict):
345343
options: NotRequired[VerifyOtpParamsOptions]
346344

347345

346+
class VerifyTokenHashParams(TypedDict):
347+
token_hash: str
348+
type: EmailOtpType
349+
options: NotRequired[VerifyOtpParamsOptions]
350+
351+
348352
VerifyOtpParams = Union[
349-
VerifyEmailOtpParams,
350-
VerifyMobileOtpParams,
353+
VerifyEmailOtpParams, VerifyMobileOtpParams, VerifyTokenHashParams
351354
]
352355

353356

0 commit comments

Comments
 (0)