From 6842ab2e3be7ffae9ce46a0613714a95cc1dd135 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Thu, 16 Jan 2020 13:50:37 -0500 Subject: [PATCH] Rename collTitle from alias "alias" is the name of a different collection field, so this renames the variable internally to make things clearer. --- oauth_signup.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/oauth_signup.go b/oauth_signup.go index 96b9936..58071c6 100644 --- a/oauth_signup.go +++ b/oauth_signup.go @@ -22,7 +22,7 @@ type viewOauthSignupVars struct { AccessToken string TokenUsername string - TokenAlias string + TokenAlias string // TODO: rename this to match the data it represents: the collection title TokenEmail string TokenRemoteUser string Provider string @@ -30,7 +30,7 @@ type viewOauthSignupVars struct { TokenHash string LoginUsername string - Alias string + Alias string // TODO: rename this to match the data it represents: the collection title Email string } @@ -52,7 +52,7 @@ const ( type oauthSignupPageParams struct { AccessToken string TokenUsername string - TokenAlias string + TokenAlias string // TODO: rename this to match the data it represents: the collection title TokenEmail string TokenRemoteUser string ClientID string @@ -131,8 +131,8 @@ func (h oauthHandler) validateOauthSignup(r *http.Request) error { if len(username) > 100 { return impart.HTTPError{Status: http.StatusBadRequest, Message: "Username is too long."} } - alias := r.FormValue(oauthParamAlias) - if len(alias) == 0 { + collTitle := r.FormValue(oauthParamAlias) + if len(collTitle) == 0 { return impart.HTTPError{Status: http.StatusBadRequest, Message: "Alias is too short."} } password := r.FormValue("password") @@ -151,7 +151,7 @@ func (h oauthHandler) validateOauthSignup(r *http.Request) error { func (h oauthHandler) showOauthSignupPage(app *App, w http.ResponseWriter, r *http.Request, tp *oauthSignupPageParams, errMsg error) error { username := tp.TokenUsername - alias := tp.TokenAlias + collTitle := tp.TokenAlias email := tp.TokenEmail session, err := app.sessionStore.Get(r, cookieName) @@ -164,7 +164,7 @@ func (h oauthHandler) showOauthSignupPage(app *App, w http.ResponseWriter, r *ht username = tmpValue } if tmpValue := r.FormValue(oauthParamAlias); len(tmpValue) > 0 { - alias = tmpValue + collTitle = tmpValue } if tmpValue := r.FormValue(oauthParamEmail); len(tmpValue) > 0 { email = tmpValue