0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-11-02 15:34:22 +01:00

prevent linking if account disabled

This commit is contained in:
Lyle Keeton 2025-10-17 00:54:21 -05:00
parent 82c51e08b2
commit 970865df06

View File

@ -217,6 +217,12 @@ func SignInOAuthCallback(ctx *context.Context) {
}
if hasUser {
if user.ProhibitLogin || !user.IsActive {
log.Info("Failed authentication attempt for %s from %s: user has disabled sign-in", user.Name, ctx.RemoteAddr())
ctx.Flash.Error(ctx.Tr("auth.prohibit_login"))
ctx.Redirect(setting.AppSubURL + "/user/login")
return
}
if err := externalaccount.LinkAccountToUser(ctx, authSource.ID, user, gothUser); err != nil {
ctx.ServerError("LinkAccountToUser", err)
return