Skip to content

Commit

Permalink
Change env var to BYPASS_OAUTH; Fix spellung
Browse files Browse the repository at this point in the history
  • Loading branch information
patch0 committed Apr 23, 2020
1 parent 4bc9b0f commit 7fb7985
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ use OmniAuth::Builder do

## Bypassing OmniAuth/OAuth

It is also possible to bypass omniauth/ entirely, which can be useful in circumstances where hostnames are dynamic, e.g. in review deployments. To do this add the following code to your OmniAuth initializer.
It is also possible to bypass OmniAuth (and OAuth) **entirely**, which can be useful in circumstances where hostnames are dynamic, e.g. in review deployments. To do this add the following code to your OmniAuth initializer.

```ruby
if ENV.has_key? 'BYPASS_AUTH' # This environment variable can be changed to whatever you like.
# We've usually used an environment variable set outside the app to trigger the
# auth bypass.
if ENV.has_key? 'BYPASS_OAUTH'
using RpiAuthBypass
OmniAuth.config.enable_rpi_auth_bypass
end
Expand All @@ -65,14 +67,14 @@ If you wish to specify your user's details, you can add the info manually with t
OmniAuth.config.add_rpi_mock(uid: '1234', info: {name: 'Example', nickname: 'Ex', email: '[email protected]' } )
```

All this could also be done inside the `OmniAuth::Bulder` block too.
All this could also be done inside the `OmniAuth::Builder` block too.

```ruby
using RpiAuthBypass

use OmniAuth::Builder do
configure do |c|
if ENV.has_key? 'BYPASS_AUTH'
if ENV.has_key? 'BYPASS_OAUTH'
c.enable_rpi_auth_bypass
c.add_rpi_mock(uid: 'foo', info: {name: ... } )
end
Expand Down

0 comments on commit 7fb7985

Please sign in to comment.