Skip to content
This repository has been archived by the owner on Apr 7, 2020. It is now read-only.

Prevent error when visiting "/_oauth" without state #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion access.lua
Original file line number Diff line number Diff line change
Expand Up @@ -257,5 +257,9 @@ end

-- if already authenticated, but still receives a /_oauth request, redirect to the correct destination
if uri == "/_oauth" then
return ngx.redirect(uri_args["state"])
if uri_args["state"] then
return ngx.redirect(uri_args["state"])
else
return ngx.redirect("/")
end
end