func oauthSignUp(ctx *middleware.Context, sid int64) { ctx.Data["Title"] = ctx.Tr("sign_up") if _, err := models.GetOauth2ById(sid); err != nil { if err == models.ErrOauth2RecordNotExist { ctx.Handle(404, "GetOauth2ById", err) } else { ctx.Handle(500, "GetOauth2ById", err) } return } ctx.Data["IsSocialLogin"] = true ctx.Data["uname"] = strings.Replace(ctx.Session.Get("socialName").(string), " ", "", -1) ctx.Data["email"] = ctx.Session.Get("socialEmail") log.Trace("social ID: %v", ctx.Session.Get("socialId")) ctx.HTML(200, SIGNUP) }
func oauthSignInPost(ctx *middleware.Context, sid int64) { ctx.Data["Title"] = "OAuth Sign Up" ctx.Data["PageIsSignUp"] = true if _, err := models.GetOauth2ById(sid); err != nil { if err == models.ErrOauth2RecordNotExist { ctx.Handle(404, "user.oauthSignUp(GetOauth2ById)", err) } else { ctx.Handle(500, "user.oauthSignUp(GetOauth2ById)", err) } return } ctx.Data["IsSocialLogin"] = true ctx.Data["username"] = ctx.Session.Get("socialName") ctx.Data["email"] = ctx.Session.Get("socialEmail") log.Trace("user.oauthSignUp(social ID): %v", ctx.Session.Get("socialId")) ctx.HTML(200, "user/signup") }