Finish the prompt page logic.

This commit is contained in:
Yang Luo
2021-06-20 09:46:06 +08:00
parent e0b6270f50
commit d3a8ab8347
8 changed files with 175 additions and 79 deletions

View File

@ -153,7 +153,10 @@ func (c *ApiController) Signup() {
}
object.AddUser(user)
//c.SetSessionUser(user)
if application.HasPromptPage() {
// The prompt page needs the user to be signed in
c.SetSessionUser(user.GetId())
}
object.DisableVerificationCode(form.Email)
object.DisableVerificationCode(checkPhone)

View File

@ -309,7 +309,7 @@ func (c *ApiController) Login() {
oldUser = object.GetUserByField(application.Organization, provider.Type, userInfo.Username)
}
if oldUser != nil {
resp = &Response{Status: "error", Msg: fmt.Sprintf("The account for provider: %s and username: %s (%s) is already linked to another account", provider.Type, userInfo.Username, userInfo.DisplayName)}
resp = &Response{Status: "error", Msg: fmt.Sprintf("The account for provider: %s and username: %s (%s) is already linked to another account: %s (%s)", provider.Type, userInfo.Username, userInfo.DisplayName, oldUser.Name, oldUser.DisplayName)}
c.Data["json"] = resp
c.ServeJSON()
return