MCPcopy Create free account
hub / github.com/gogs/gogs / GetRecoveryCodesByUserID

Function GetRecoveryCodesByUserID

internal/database/two_factor.go:65–68  ·  view source on GitHub ↗

GetRecoveryCodesByUserID returns all recovery codes of given user.

(userID int64)

Source from the content-addressed store, hash-verified

63
64// GetRecoveryCodesByUserID returns all recovery codes of given user.
65func GetRecoveryCodesByUserID(userID int64) ([]*TwoFactorRecoveryCode, error) {
66 recoveryCodes := make([]*TwoFactorRecoveryCode, 0, 10)
67 return recoveryCodes, x.Where("user_id = ?", userID).Find(&recoveryCodes)
68}
69
70func deleteRecoveryCodesByUserID(e Engine, userID int64) error {
71 _, err := e.Where("user_id = ?", userID).Delete(new(TwoFactorRecoveryCode))

Callers 1

Calls 2

WhereMethod · 0.80
FindMethod · 0.65

Tested by

no test coverage detected