fix: redirect to register (#437)

This commit is contained in:
Livio Amstutz
2020-07-09 18:01:58 +02:00
committed by GitHub
parent 8f1c31f37d
commit da113ffb95
2 changed files with 6 additions and 1 deletions

View File

@@ -12,6 +12,7 @@ const (
type loginData struct {
LoginName string `schema:"loginName"`
Register bool `schema:"register"`
}
func (l *Login) handleLogin(w http.ResponseWriter, r *http.Request) {
@@ -43,6 +44,10 @@ func (l *Login) handleLoginNameCheck(w http.ResponseWriter, r *http.Request) {
l.renderError(w, r, authReq, err)
return
}
if data.Register {
l.handleRegister(w, r)
return
}
err = l.authRepo.CheckLoginName(r.Context(), authReq.ID, data.LoginName)
if err != nil {
l.renderLogin(w, r, authReq, err)

View File

@@ -21,7 +21,7 @@
<div class="actions">
<button class="primary right" type="submit">{{t "Actions.Next"}}</button>
<button class="secondary right" href="{{ registerUrl .AuthReqID }}" formnovalidate>{{t "Actions.Register"}}</button>
<button class="secondary right" name="register" value="true" formnovalidate>{{t "Actions.Register"}}</button>
</div>
</form>