Fix active session must not be return if expired
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -144,9 +144,12 @@ func (r *membershipResolver) ActiveSession(ctx context.Context, obj *types.Membe
|
||||
|
||||
session, err := r.iam.SessionService.GetActiveSessionForMembership(ctx, rootSession.UserID, obj.ID)
|
||||
if err != nil {
|
||||
var errSessionNotFound *iam.ErrSessionNotFound
|
||||
var (
|
||||
errSessionNotFound *iam.ErrSessionNotFound
|
||||
errSessionExpired *iam.ErrSessionExpired
|
||||
)
|
||||
|
||||
if errors.As(err, &errSessionNotFound) {
|
||||
if errors.As(err, &errSessionNotFound) || errors.As(err, &errSessionExpired) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user