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

Method SetOtpCode

internal/models/challenge.go:98–110  ·  view source on GitHub ↗
(otpCode string, encrypt bool, encryptionKeyID, encryptionKey string)

Source from the content-addressed store, hash-verified

96}
97
98func (c *Challenge) SetOtpCode(otpCode string, encrypt bool, encryptionKeyID, encryptionKey string) error {
99 c.OtpCode = otpCode
100 if encrypt {
101 es, err := crypto.NewEncryptedString(c.ID.String(), []byte(otpCode), encryptionKeyID, encryptionKey)
102 if err != nil {
103 return err
104 }
105
106 c.OtpCode = es.String()
107 }
108 return nil
109
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 {

Callers 2

verifyPhoneFactorMethod · 0.80
CreatePhoneChallengeMethod · 0.80

Calls 3

StringMethod · 0.95
NewEncryptedStringFunction · 0.92
StringMethod · 0.45

Tested by

no test coverage detected