Fix false login state on OAuth signup page

Having a `Username` field populated in the page data tells the base
template to display navigation that only a logged in user should see. So
this renames the field to `LoginUsername`, similar to our login.tmpl
page.

Ref T712
This commit is contained in:
Matt Baer 2020-01-16 13:37:44 -05:00
parent 33a6129d1e
commit 4d5c89e7ef
2 changed files with 7 additions and 7 deletions

View File

@ -29,9 +29,9 @@ type viewOauthSignupVars struct {
ClientID string
TokenHash string
Username string
Alias string
Email string
LoginUsername string
Alias string
Email string
}
const (
@ -184,9 +184,9 @@ func (h oauthHandler) showOauthSignupPage(app *App, w http.ResponseWriter, r *ht
ClientID: tp.ClientID,
TokenHash: tp.TokenHash,
Username: username,
Alias: alias,
Email: email,
LoginUsername: username,
Alias: collTitle,
Email: email,
}
// Display any error messages

View File

@ -85,7 +85,7 @@ form dd {
<label>
<dt>Username</dt>
<dd>
<input type="text" id="username" name="username" style="width: 100%; box-sizing: border-box;" placeholder="Username" value="{{.Username}}" /><br />
<input type="text" id="username" name="username" style="width: 100%; box-sizing: border-box;" placeholder="Username" value="{{.LoginUsername}}" /><br />
{{if .Federation}}<p id="alias-site" class="demo">@<strong>your-username</strong>@{{.FriendlyHost}}</p>{{else}}<p id="alias-site" class="demo">{{.FriendlyHost}}/<strong>your-username</strong></p>{{end}}
</dd>
</label>