-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip routing callback request if not in callback phase
There are other routes in OmniAuth strategies that will not assign `omniauth.auth`, and we don't want `omniauth_provider` to error or return `nil` in this case.
- Loading branch information
Showing
3 changed files
with
18 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,6 +135,23 @@ | |
assert_equal '{"name":"New Name","email":"[email protected]"}', DB[:account_identities].first[:info] | ||
end | ||
|
||
it "gracefully handles GET on request phase when GET is not allowed" do | ||
OmniAuth.config.allowed_request_methods = %i[post] | ||
|
||
rodauth do | ||
enable :omniauth | ||
omniauth_provider :developer | ||
end | ||
roda do |r| | ||
r.rodauth | ||
end | ||
|
||
visit "/auth/developer" | ||
assert_equal 404, page.status_code | ||
|
||
OmniAuth.config.allowed_request_methods = %i[get post] | ||
end | ||
|
||
it "deletes omniauth identities when account is closed" do | ||
rodauth do | ||
enable :omniauth, :close_account | ||
|