|
|
@ -7,20 +7,20 @@ package user |
|
|
|
import ( |
|
|
|
import ( |
|
|
|
"errors" |
|
|
|
"errors" |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
|
|
|
|
"net/http" |
|
|
|
"net/url" |
|
|
|
"net/url" |
|
|
|
|
|
|
|
"strings" |
|
|
|
"github.com/go-macaron/captcha" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"code.gitea.io/gitea/models" |
|
|
|
"code.gitea.io/gitea/models" |
|
|
|
"code.gitea.io/gitea/modules/auth" |
|
|
|
"code.gitea.io/gitea/modules/auth" |
|
|
|
|
|
|
|
"code.gitea.io/gitea/modules/auth/oauth2" |
|
|
|
"code.gitea.io/gitea/modules/base" |
|
|
|
"code.gitea.io/gitea/modules/base" |
|
|
|
"code.gitea.io/gitea/modules/context" |
|
|
|
"code.gitea.io/gitea/modules/context" |
|
|
|
"code.gitea.io/gitea/modules/log" |
|
|
|
"code.gitea.io/gitea/modules/log" |
|
|
|
"code.gitea.io/gitea/modules/setting" |
|
|
|
"code.gitea.io/gitea/modules/setting" |
|
|
|
"net/http" |
|
|
|
|
|
|
|
"code.gitea.io/gitea/modules/auth/oauth2" |
|
|
|
"github.com/go-macaron/captcha" |
|
|
|
"github.com/markbates/goth" |
|
|
|
"github.com/markbates/goth" |
|
|
|
"strings" |
|
|
|
|
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
const ( |
|
|
|
const ( |
|
|
@ -144,6 +144,8 @@ func SignInPost(ctx *context.Context, form auth.SignInForm) { |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
if models.IsErrUserNotExist(err) { |
|
|
|
if models.IsErrUserNotExist(err) { |
|
|
|
ctx.RenderWithErr(ctx.Tr("form.username_password_incorrect"), tplSignIn, &form) |
|
|
|
ctx.RenderWithErr(ctx.Tr("form.username_password_incorrect"), tplSignIn, &form) |
|
|
|
|
|
|
|
} else if models.IsErrEmailAlreadyUsed(err) { |
|
|
|
|
|
|
|
ctx.RenderWithErr(ctx.Tr("form.email_been_used"), tplSignIn, &form) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
ctx.Handle(500, "UserSignIn", err) |
|
|
|
ctx.Handle(500, "UserSignIn", err) |
|
|
|
} |
|
|
|
} |
|
|
|