mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 19:17:32 +00:00
fix: redirect to register (#437)
This commit is contained in:
@@ -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)
|
||||
|
@@ -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>
|
||||
|
||||
|
Reference in New Issue
Block a user