Browse Source

add basic auth

master
Richard Cagle 1 year ago
parent
commit
b720d141c0
2 changed files with 6 additions and 0 deletions
  1. 2
    0
      .env.example
  2. 4
    0
      app.rb

+ 2
- 0
.env.example View File

@@ -4,3 +4,5 @@ export BASECAMP_CLIENT_ID=
export BASECAMP_CLIENT_SECRET=
export REDIRECT_URL="http://localhost:4567/oauth-token"
export TIMEZONE="US/Central"
export AUTH_USER=
export AUTH_PASS=

+ 4
- 0
app.rb View File

@@ -11,6 +11,10 @@ require "sinatra"
require "sinatra/reloader" if development?
require "sinatra/json"

use Rack::Auth::Basic, "Protected Area" do |username, password|
username == ENV.fetch("AUTH_USER") && password == ENV.fetch("AUTH_PASS")
end

SuckerPunch.logger = Logger.new(STDOUT)

ActiveRecord::Base.logger = Logger.new(STDOUT)

Loading…
Cancel
Save