simple_admin_auth 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +6 -6
- data/lib/simple_admin_auth/application.rb +2 -2
- data/lib/simple_admin_auth/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -12,15 +12,15 @@ Add this line to your application's Gemfile:
|
|
12
12
|
|
13
13
|
Create an initialiser configuring your domain:
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
Rails.application.config.middleware.use SimpleAdminAuth::Builder do
|
16
|
+
provider :google_apps, :domain => 'yourdomain.com', :name => 'admin'
|
17
|
+
end
|
18
18
|
|
19
19
|
Protect any routes that require authentication:
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
constraints SimpleAdminAuth::Authenticate do
|
22
|
+
mount MongoRequestLogger::Viewer, :at => "/log"
|
23
|
+
end
|
24
24
|
|
25
25
|
An user may be logged out by linking to `/auth/admin/logout`, or by clearing `session[:admin_user]`.
|
26
26
|
|
@@ -13,7 +13,7 @@ module SimpleAdminAuth
|
|
13
13
|
|
14
14
|
get_or_post '/auth/admin/callback' do
|
15
15
|
auth_hash = request.env['omniauth.auth']
|
16
|
-
|
16
|
+
|
17
17
|
session[:admin_user] = auth_hash['info']
|
18
18
|
|
19
19
|
return_url = session[:admin_login_return_url] || '/'
|
@@ -53,7 +53,7 @@ __END__
|
|
53
53
|
@@ login
|
54
54
|
<html>
|
55
55
|
<head><title>Admin Login</title>
|
56
|
-
<link rel="stylesheet" href="
|
56
|
+
<link rel="stylesheet" href="/auth/admin/bootstrap.css" />
|
57
57
|
<style type="text/css">
|
58
58
|
body {
|
59
59
|
background-color: #F9F9F9;
|