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

Method GetOtpCode

internal/models/challenge.go:112–124  ·  view source on GitHub ↗
(decryptionKeys map[string]string, encrypt bool, encryptionKeyID string)

Source from the content-addressed store, hash-verified

110}
111
112func (c *Challenge) GetOtpCode(decryptionKeys map[string]string, encrypt bool, encryptionKeyID string) (string, bool, error) {
113 if es := crypto.ParseEncryptedString(c.OtpCode); es != nil {
114 bytes, err := es.Decrypt(c.ID.String(), decryptionKeys)
115 if err != nil {
116 return "", false, err
117 }
118
119 return string(bytes), encrypt && es.ShouldReEncrypt(encryptionKeyID), nil
120 }
121
122 return c.OtpCode, encrypt, nil
123
124}

Callers 1

verifyPhoneFactorMethod · 0.80

Calls 4

ParseEncryptedStringFunction · 0.92
DecryptMethod · 0.80
ShouldReEncryptMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected