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

Method FindChallengeByID

internal/models/factor.go:425–434  ·  view source on GitHub ↗
(conn *storage.Connection, challengeID uuid.UUID)

Source from the content-addressed store, hash-verified

423}
424
425func (f *Factor) FindChallengeByID(conn *storage.Connection, challengeID uuid.UUID) (*Challenge, error) {
426 var challenge Challenge
427 err := conn.Q().Where("id = ? and factor_id = ?", challengeID, f.ID).First(&challenge)
428 if err != nil && errors.Cause(err) == sql.ErrNoRows {
429 return nil, ChallengeNotFoundError{}
430 } else if err != nil {
431 return nil, err
432 }
433 return &challenge, nil
434}
435
436func DeleteFactorsByUserId(tx *storage.Connection, userId uuid.UUID) error {
437 if err := tx.RawQuery("DELETE FROM "+(&pop.Model{Value: Factor{}}).TableName()+" WHERE user_id = ?", userId).Exec(); err != nil {

Callers 2

TestMFAVerifyFactorMethod · 0.95
validateChallengeMethod · 0.80

Calls 1

CauseMethod · 0.65

Tested by 1

TestMFAVerifyFactorMethod · 0.76