Skip to content

Commit

Permalink
Merge pull request #264 from vershnik/check_session_error
Browse files Browse the repository at this point in the history
added error handling when opening session.
  • Loading branch information
bodewig authored Apr 25, 2019
2 parents b8277e2 + 6bd4b79 commit 08ff5ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
04/23/2019
- error handling when starting session

03/18/2019
- fixed accidental use of global variable err in revoke_tokens_on_logout;
see #253, #254; thanks @arcivanov
Expand Down
6 changes: 5 additions & 1 deletion lib/resty/openidc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,11 @@ function openidc.authenticate(opts, target_url, unauth_action, session_opts)

local err

local session = r_session.start(session_opts)
local session, session_error = r_session.start(session_opts)
if session == nil then
log(ERROR, "Error starting session: " .. session_error)
return nil, session_error, target_url, session
end

target_url = target_url or ngx.var.request_uri

Expand Down

0 comments on commit 08ff5ab

Please sign in to comment.