Skip to content

Commit 8dfd8c7

Browse files
committed
only try to revoke tokens we've actualy received
1 parent a5700c8 commit 8dfd8c7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/resty/openidc.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,8 +1141,12 @@ local function openidc_logout(opts, session)
11411141
if opts.revoke_tokens_on_logout then
11421142
log(DEBUG, "revoke_tokens_on_logout is enabled. " ..
11431143
"trying to revoke access and refresh tokens...")
1144-
openidc_revoke_token(opts, "refresh_token", refresh_token)
1145-
openidc_revoke_token(opts, "access_token", access_token)
1144+
if refresh_token then
1145+
openidc_revoke_token(opts, "refresh_token", refresh_token)
1146+
end
1147+
if access_token then
1148+
openidc_revoke_token(opts, "access_token", access_token)
1149+
end
11461150
end
11471151

11481152
local headers = ngx.req.get_headers()

0 commit comments

Comments
 (0)