mirror of
https://github.com/pomerium/pomerium.git
synced 2025-04-29 18:36:30 +02:00
only check impersonate id on non-nil pbSession
This commit is contained in:
parent
b6c1068de7
commit
a6f7ca5abd
1 changed files with 9 additions and 4 deletions
|
@ -453,15 +453,20 @@ func (a *Authenticate) userInfo(w http.ResponseWriter, r *http.Request) error {
|
|||
|
||||
isImpersonated := false
|
||||
pbSession, err := session.Get(ctx, state.dataBrokerClient, s.ID)
|
||||
if pbSession.GetImpersonateSessionId() != "" {
|
||||
pbSession, err = session.Get(ctx, state.dataBrokerClient, pbSession.GetImpersonateSessionId())
|
||||
isImpersonated = true
|
||||
}
|
||||
if err != nil {
|
||||
pbSession = &session.Session{
|
||||
Id: s.ID,
|
||||
}
|
||||
}
|
||||
if pbSession.GetImpersonateSessionId() != "" {
|
||||
pbSession, err = session.Get(ctx, state.dataBrokerClient, pbSession.GetImpersonateSessionId())
|
||||
isImpersonated = true
|
||||
if err != nil {
|
||||
pbSession = &session.Session{
|
||||
Id: s.ID,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pbUser, err := user.Get(ctx, state.dataBrokerClient, pbSession.GetUserId())
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue