|
|
|
@ -102,22 +102,23 @@ func SignInOpenIDPost(ctx *context.Context, form auth.SignInOpenIDForm) { |
|
|
|
|
id, err := openid.Normalize(form.Openid) |
|
|
|
|
if err != nil { |
|
|
|
|
ctx.RenderWithErr(err.Error(), tplSignInOpenID, &form) |
|
|
|
|
return; |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
form.Openid = id |
|
|
|
|
|
|
|
|
|
log.Trace("OpenID uri: " + id) |
|
|
|
|
|
|
|
|
|
err = allowedOpenIDURI(id); if err != nil { |
|
|
|
|
err = allowedOpenIDURI(id) |
|
|
|
|
if err != nil { |
|
|
|
|
ctx.RenderWithErr(err.Error(), tplSignInOpenID, &form) |
|
|
|
|
return; |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
redirectTo := setting.AppURL + "user/login/openid" |
|
|
|
|
url, err := openid.RedirectURL(id, redirectTo, setting.AppURL) |
|
|
|
|
if err != nil { |
|
|
|
|
ctx.RenderWithErr(err.Error(), tplSignInOpenID, &form) |
|
|
|
|
return; |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Request optional nickname and email info
|
|
|
|
@ -351,7 +352,9 @@ func RegisterOpenIDPost(ctx *context.Context, cpt *captcha.Captcha, form auth.Si |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
len := setting.MinPasswordLength |
|
|
|
|
if len < 256 { len = 256 } |
|
|
|
|
if len < 256 { |
|
|
|
|
len = 256 |
|
|
|
|
} |
|
|
|
|
password, err := base.GetRandomString(len) |
|
|
|
|
if err != nil { |
|
|
|
|
ctx.RenderWithErr(err.Error(), tplSignUpOID, form) |
|
|
|
|