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

Function GenerateResetPasswordCode

internal/userutil/userutil.go:43–45  ·  view source on GitHub ↗

GenerateResetPasswordCode generates a password-reset code based on user information and the given email. The token's lifetime is bound to [conf.AuthOpts.ResetPasswordCodeLives].

(userID int64, email, name, password, rands string)

Source from the content-addressed store, hash-verified

41// information and the given email. The token's lifetime is bound to
42// [conf.AuthOpts.ResetPasswordCodeLives].
43func GenerateResetPasswordCode(userID int64, email, name, password, rands string) string {
44 return generateTimeLimitedUserCode(userID, email, name, password, rands, conf.Auth.ResetPasswordCodeLives)
45}
46
47func generateTimeLimitedUserCode(userID int64, email, name, password, rands string, minutes int) string {
48 code := tool.CreateTimeLimitCode(

Callers 1

Calls 1

Tested by

no test coverage detected