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

Method SetSecret

internal/models/factor.go:271–283  ·  view source on GitHub ↗
(secret string, encrypt bool, encryptionKeyID, encryptionKey string)

Source from the content-addressed store, hash-verified

269}
270
271func (f *Factor) SetSecret(secret string, encrypt bool, encryptionKeyID, encryptionKey string) error {
272 f.Secret = secret
273 if encrypt {
274 es, err := crypto.NewEncryptedString(f.ID.String(), []byte(secret), encryptionKeyID, encryptionKey)
275 if err != nil {
276 return err
277 }
278
279 f.Secret = es.String()
280 }
281
282 return nil
283}
284
285func (f *Factor) GetSecret(decryptionKeys map[string]string, encrypt bool, encryptionKeyID string) (string, bool, error) {
286 if es := crypto.ParseEncryptedString(f.Secret); es != nil {

Callers 8

enrollTOTPFactorMethod · 0.95
SetupTestMethod · 0.80
enrollVerifiedFactorMethod · 0.80
verifyTOTPFactorMethod · 0.80
SetupTestMethod · 0.80

Calls 3

StringMethod · 0.95
NewEncryptedStringFunction · 0.92
StringMethod · 0.45

Tested by 6

SetupTestMethod · 0.64
enrollVerifiedFactorMethod · 0.64
SetupTestMethod · 0.64