MCPcopy Create free account
hub / github.com/supabase/auth / ParseAuthenticationMethod

Function ParseAuthenticationMethod

internal/models/factor.go:111–150  ·  view source on GitHub ↗
(authMethod string)

Source from the content-addressed store, hash-verified

109}
110
111func ParseAuthenticationMethod(authMethod string) (AuthenticationMethod, error) {
112 if strings.HasSuffix(authMethod, "signup") {
113 authMethod = "email/signup"
114 }
115 switch authMethod {
116 case "oauth":
117 return OAuth, nil
118 case "password":
119 return PasswordGrant, nil
120 case "otp":
121 return OTP, nil
122 case "totp":
123 return TOTPSignIn, nil
124 case "recovery":
125 return Recovery, nil
126 case "invite":
127 return Invite, nil
128 case "sso/saml":
129 return SSOSAML, nil
130 case "magiclink":
131 return MagicLink, nil
132 case "email/signup":
133 return EmailSignup, nil
134 case "email_change":
135 return EmailChange, nil
136 case "token_refresh":
137 return TokenRefresh, nil
138 case "mfa/sms":
139 return MFAPhone, nil
140 case "mfa/webauthn":
141 return MFAWebAuthn, nil
142 case "web3":
143 return Web3, nil
144 case "oauth_provider/authorization_code":
145 return OAuthProviderAuthorizationCode, nil
146 case "passkey":
147 return PasskeyLogin, nil
148 }
149 return 0, fmt.Errorf("unsupported authentication method %q", authMethod)
150}
151
152type Factor struct {
153 ID uuid.UUID `json:"id" db:"id"`

Callers 3

verifyGetMethod · 0.92
PKCEMethod · 0.92
IsRecoveryMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected