mirror of
https://github.com/zitadel/zitadel.git
synced 2025-04-28 09:20:52 +00:00
28 lines
623 B
Go
28 lines
623 B
Go
![]() |
package handler
|
||
|
|
||
|
import (
|
||
|
"github.com/caos/zitadel/internal/auth_request/model"
|
||
|
"net/http"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
queryAuthRequestID = "authRequestID"
|
||
|
)
|
||
|
|
||
|
func (l *Login) getAuthRequest(r *http.Request) (*model.AuthRequest, error) {
|
||
|
authRequestID := r.FormValue(queryAuthRequestID)
|
||
|
if authRequestID == "" {
|
||
|
return nil, nil
|
||
|
}
|
||
|
return l.authRepo.AuthRequestByID(r.Context(), authRequestID)
|
||
|
}
|
||
|
|
||
|
func (l *Login) getAuthRequestAndParseData(r *http.Request, data interface{}) (*model.AuthRequest, error) {
|
||
|
authReq, err := l.getAuthRequest(r)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
err = l.parser.Parse(r, data)
|
||
|
return authReq, err
|
||
|
}
|