Skip to content

Commit

Permalink
Allow changing of query parameters in on_created call
Browse files Browse the repository at this point in the history
Signed-off-by: Oldřich Jedlička <[email protected]>
  • Loading branch information
oldium committed Dec 28, 2023
1 parent 53299ec commit bf5809b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ h2JHukolz9xf6qN61QMLSd83+kwoBr2drp6xg3eGDLIkQCQLrkY=
-- }
--
-- where `handle_created`, `handle_authenticated`, `handle_regenerated` and `handle_logout` are callables
-- accepting a single argument `session`
-- accepting argument `session`. `handle_created` accepts also second argument `params` which is a table
-- containing the query parameters of the authorization request used to redirect the user to the OpenID
-- Connect provider endpoint.
--
-- -- `on_created` hook is invoked *after* a session has been created in
-- `openidc_authorize` immediately prior to saving the session
Expand Down
2 changes: 1 addition & 1 deletion lib/resty/openidc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ local function openidc_authorize(opts, session, target_url, prompt)
session:set("last_authenticated", ngx.time())

if opts.lifecycle and opts.lifecycle.on_created then
err = opts.lifecycle.on_created(session)
err = opts.lifecycle.on_created(session, params)
if err then
log(WARN, "failed in `on_created` handler: " .. err)
return err
Expand Down

0 comments on commit bf5809b

Please sign in to comment.