MCPcopy
hub / github.com/pocketbase/pocketbase / HasExpired

Method HasExpired

core/mfa_model.go:118–120  ·  view source on GitHub ↗

HasExpired checks if the mfa is expired, aka. whether it has been more than maxElapsed time since its creation.

(maxElapsed time.Duration)

Source from the content-addressed store, hash-verified

116// HasExpired checks if the mfa is expired, aka. whether it has been
117// more than maxElapsed time since its creation.
118func (m *MFA) HasExpired(maxElapsed time.Duration) bool {
119 return time.Since(m.Created().Time()) > maxElapsed
120}
121
122func (app *BaseApp) registerMFAHooks() {
123 recordRefHooks[*MFA](app, CollectionNameMFAs, CollectionTypeAuth)

Callers 2

TestMFAHasExpiredFunction · 0.95
checkMFAFunction · 0.95

Calls 2

CreatedMethod · 0.95
TimeMethod · 0.80

Tested by 1

TestMFAHasExpiredFunction · 0.76