Rename collTitle from alias
"alias" is the name of a different collection field, so this renames the variable internally to make things clearer.
This commit is contained in:
parent
4d5c89e7ef
commit
6842ab2e3b
|
@ -22,7 +22,7 @@ type viewOauthSignupVars struct {
|
||||||
|
|
||||||
AccessToken string
|
AccessToken string
|
||||||
TokenUsername string
|
TokenUsername string
|
||||||
TokenAlias string
|
TokenAlias string // TODO: rename this to match the data it represents: the collection title
|
||||||
TokenEmail string
|
TokenEmail string
|
||||||
TokenRemoteUser string
|
TokenRemoteUser string
|
||||||
Provider string
|
Provider string
|
||||||
|
@ -30,7 +30,7 @@ type viewOauthSignupVars struct {
|
||||||
TokenHash string
|
TokenHash string
|
||||||
|
|
||||||
LoginUsername string
|
LoginUsername string
|
||||||
Alias string
|
Alias string // TODO: rename this to match the data it represents: the collection title
|
||||||
Email string
|
Email string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ const (
|
||||||
type oauthSignupPageParams struct {
|
type oauthSignupPageParams struct {
|
||||||
AccessToken string
|
AccessToken string
|
||||||
TokenUsername string
|
TokenUsername string
|
||||||
TokenAlias string
|
TokenAlias string // TODO: rename this to match the data it represents: the collection title
|
||||||
TokenEmail string
|
TokenEmail string
|
||||||
TokenRemoteUser string
|
TokenRemoteUser string
|
||||||
ClientID string
|
ClientID string
|
||||||
|
@ -131,8 +131,8 @@ func (h oauthHandler) validateOauthSignup(r *http.Request) error {
|
||||||
if len(username) > 100 {
|
if len(username) > 100 {
|
||||||
return impart.HTTPError{Status: http.StatusBadRequest, Message: "Username is too long."}
|
return impart.HTTPError{Status: http.StatusBadRequest, Message: "Username is too long."}
|
||||||
}
|
}
|
||||||
alias := r.FormValue(oauthParamAlias)
|
collTitle := r.FormValue(oauthParamAlias)
|
||||||
if len(alias) == 0 {
|
if len(collTitle) == 0 {
|
||||||
return impart.HTTPError{Status: http.StatusBadRequest, Message: "Alias is too short."}
|
return impart.HTTPError{Status: http.StatusBadRequest, Message: "Alias is too short."}
|
||||||
}
|
}
|
||||||
password := r.FormValue("password")
|
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 {
|
func (h oauthHandler) showOauthSignupPage(app *App, w http.ResponseWriter, r *http.Request, tp *oauthSignupPageParams, errMsg error) error {
|
||||||
username := tp.TokenUsername
|
username := tp.TokenUsername
|
||||||
alias := tp.TokenAlias
|
collTitle := tp.TokenAlias
|
||||||
email := tp.TokenEmail
|
email := tp.TokenEmail
|
||||||
|
|
||||||
session, err := app.sessionStore.Get(r, cookieName)
|
session, err := app.sessionStore.Get(r, cookieName)
|
||||||
|
@ -164,7 +164,7 @@ func (h oauthHandler) showOauthSignupPage(app *App, w http.ResponseWriter, r *ht
|
||||||
username = tmpValue
|
username = tmpValue
|
||||||
}
|
}
|
||||||
if tmpValue := r.FormValue(oauthParamAlias); len(tmpValue) > 0 {
|
if tmpValue := r.FormValue(oauthParamAlias); len(tmpValue) > 0 {
|
||||||
alias = tmpValue
|
collTitle = tmpValue
|
||||||
}
|
}
|
||||||
if tmpValue := r.FormValue(oauthParamEmail); len(tmpValue) > 0 {
|
if tmpValue := r.FormValue(oauthParamEmail); len(tmpValue) > 0 {
|
||||||
email = tmpValue
|
email = tmpValue
|
||||||
|
|
Loading…
Reference in New Issue