diff options
author | Unknwon <u@gogs.io> | 2016-03-14 16:44:05 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-03-14 16:44:05 -0400 |
commit | 8966f5635da0caf2c1f4034a61279b614da51e41 (patch) | |
tree | 448d16fae7e31ddfbffb523a15e6ef8a22d21590 /routers/user | |
parent | 9bd9ad420582a7a34d18011847bb789f64271b1f (diff) | |
parent | 63e21c146aa3fda2715d55235d54dfb95a9077cc (diff) | |
download | gitea-8966f5635da0caf2c1f4034a61279b614da51e41.tar.gz gitea-8966f5635da0caf2c1f4034a61279b614da51e41.zip |
Merge pull request #2823 from zacheryph/feature/local-only-password-reset
Prevent `Forgot Password` for non local users
Diffstat (limited to 'routers/user')
-rw-r--r-- | routers/user/auth.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/routers/user/auth.go b/routers/user/auth.go index 646b878396..9b48357aaa 100644 --- a/routers/user/auth.go +++ b/routers/user/auth.go @@ -343,6 +343,12 @@ func ForgotPasswdPost(ctx *context.Context) { return } + if !u.IsLocal() { + ctx.Data["Err_Email"] = true + ctx.RenderWithErr(ctx.Tr("auth.non_local_account"), FORGOT_PASSWORD, nil) + return + } + if ctx.Cache.IsExist("MailResendLimit_" + u.LowerName) { ctx.Data["ResendLimited"] = true ctx.HTML(200, FORGOT_PASSWORD) |