mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-25 05:58:45 +00:00
fix: potential panics in login and return proper http 405 (#8065)
# Which Problems Are Solved We identified some parts in the code, which could panic with a nil pointer when accessed without auth request. Additionally, if a GRPC method was called with an unmapped HTTP method, e.g. POST instead of GET a 501 instead of a 405 was returned. # How the Problems Are Solved - Additional checks for existing authRequest - custom http status code mapper for gateway # Additional Changes None. # Additional Context - noted internally in OPS
This commit is contained in:
@@ -69,7 +69,7 @@ func (l *Login) handleLoginNameCheck(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
if data.Register {
|
||||
if authReq.LoginPolicy != nil && authReq.LoginPolicy.AllowExternalIDP && authReq.AllowedExternalIDPs != nil && len(authReq.AllowedExternalIDPs) > 0 {
|
||||
if authReq != nil && authReq.LoginPolicy != nil && authReq.LoginPolicy.AllowExternalIDP && authReq.AllowedExternalIDPs != nil && len(authReq.AllowedExternalIDPs) > 0 {
|
||||
l.handleRegisterOption(w, r)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user