mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 03:37:34 +00:00
fix: redirect to register (#437)
This commit is contained in:
@@ -12,6 +12,7 @@ const (
|
|||||||
|
|
||||||
type loginData struct {
|
type loginData struct {
|
||||||
LoginName string `schema:"loginName"`
|
LoginName string `schema:"loginName"`
|
||||||
|
Register bool `schema:"register"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *Login) handleLogin(w http.ResponseWriter, r *http.Request) {
|
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)
|
l.renderError(w, r, authReq, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if data.Register {
|
||||||
|
l.handleRegister(w, r)
|
||||||
|
return
|
||||||
|
}
|
||||||
err = l.authRepo.CheckLoginName(r.Context(), authReq.ID, data.LoginName)
|
err = l.authRepo.CheckLoginName(r.Context(), authReq.ID, data.LoginName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
l.renderLogin(w, r, authReq, err)
|
l.renderLogin(w, r, authReq, err)
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<button class="primary right" type="submit">{{t "Actions.Next"}}</button>
|
<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>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user