mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-12 11:43:40 +00:00
fix: race condition in auth request unmarshalling (#1993)
This commit is contained in:
parent
c950d6d272
commit
f93337e99b
@ -111,11 +111,11 @@ const (
|
||||
)
|
||||
|
||||
func NewAuthRequestFromType(requestType AuthRequestType) (*AuthRequest, error) {
|
||||
request, ok := authRequestTypeMapping[requestType]
|
||||
if !ok {
|
||||
return nil, errors.ThrowInvalidArgument(nil, "DOMAIN-ds2kl", "invalid request type")
|
||||
switch requestType {
|
||||
case AuthRequestTypeOIDC:
|
||||
return &AuthRequest{Request: &AuthRequestOIDC{}}, nil
|
||||
}
|
||||
return &AuthRequest{Request: request}, nil
|
||||
return nil, errors.ThrowInvalidArgument(nil, "DOMAIN-ds2kl", "invalid request type")
|
||||
}
|
||||
|
||||
func (a *AuthRequest) WithCurrentInfo(info *BrowserInfo) *AuthRequest {
|
||||
|
@ -15,12 +15,6 @@ type Request interface {
|
||||
|
||||
type AuthRequestType int32
|
||||
|
||||
var (
|
||||
authRequestTypeMapping = map[AuthRequestType]Request{
|
||||
AuthRequestTypeOIDC: &AuthRequestOIDC{},
|
||||
}
|
||||
)
|
||||
|
||||
const (
|
||||
AuthRequestTypeOIDC AuthRequestType = iota
|
||||
AuthRequestTypeSAML
|
||||
|
Loading…
x
Reference in New Issue
Block a user