lib/sinatra/auth/github.rb in sinatra_auth_github-0.0.1 vs lib/sinatra/auth/github.rb in sinatra_auth_github-0.0.2
- old
+ new
@@ -26,10 +26,14 @@
end
def github_user
warden.user
end
+
+ def relative_url_for(path)
+ request.script_name + path
+ end
end
def self.registered(app)
app.use Warden::Manager do |manager|
manager.default_strategies :github
@@ -43,10 +47,10 @@
app.helpers Helpers
app.get '/auth/github/callback' do
authenticate!
- redirect "/"
+ redirect relative_url_for('/')
end
end
end
end
end