This commit is contained in:
2026-03-23 18:55:27 +07:00
parent 6dc0322fe5
commit 3626c12319
47 changed files with 2741 additions and 0 deletions

40
pkg/constant/token.go Normal file
View File

@@ -0,0 +1,40 @@
package constant
type TokenType int16
const (
TokenPasswordReset TokenType = 1
TokenEmailVerify TokenType = 2
TokenMagicLink TokenType = 3
TokenRefreshToken TokenType = 4
)
func (t TokenType) String() string {
switch t {
case TokenPasswordReset:
return "PASSWORD_RESET"
case TokenEmailVerify:
return "EMAIL_VERIFY"
case TokenMagicLink:
return "LOGIN_MAGIC_LINK"
case TokenRefreshToken:
return "REFRESH_TOKEN"
default:
return "UNKNOWN"
}
}
func ParseTokenType(v int16) TokenType {
switch v {
case 1:
return TokenPasswordReset
case 2:
return TokenEmailVerify
case 3:
return TokenMagicLink
case 4:
return TokenRefreshToken
default:
return 0
}
}