Skip to content

Commit

Permalink
Merge pull request #153 from tiramizoo/basic-auth
Browse files Browse the repository at this point in the history
Add info how to setup basic auth for engine
  • Loading branch information
bensheldon committed Sep 29, 2020
2 parents 56e54fd + 0608cf2 commit 7fce463
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,16 @@ GoodJob includes a Dashboard as a mountable `Rails::Engine`.
end
```
Another option is using basic auth like this:
```ruby
# config/initializers/good_job.rb
GoodJob::Engine.middleware.use(Rack::Auth::Basic) do |username, password|
ActiveSupport::SecurityUtils.secure_compare(Rails.application.credentials.good_job_username, username) &&
ActiveSupport::SecurityUtils.secure_compare(Rails.application.credentials.good_job_password, password)
end
```
## Go deeper
### Exceptions, retries, and reliability
Expand Down

0 comments on commit 7fce463

Please sign in to comment.