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

Method CreateChallenge

internal/models/factor.go:350–359  ·  view source on GitHub ↗
(ipAddress string)

Source from the content-addressed store, hash-verified

348}
349
350func (f *Factor) CreateChallenge(ipAddress string) *Challenge {
351 id := uuid.Must(uuid.NewV4())
352 challenge := &Challenge{
353 ID: id,
354 FactorID: f.ID,
355 IPAddress: ipAddress,
356 }
357
358 return challenge
359}
360func (f *Factor) WriteChallengeToDatabase(tx *storage.Connection, challenge *Challenge) error {
361 if challenge.FactorID != f.ID {
362 return errors.New("Can only write challenges that you own")

Callers 3

TestMFAVerifyFactorMethod · 0.95
CreatePhoneChallengeMethod · 0.95
challengeTOTPFactorMethod · 0.80

Calls

no outgoing calls

Tested by 1

TestMFAVerifyFactorMethod · 0.76