google_auth 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4622e8055845c9abf398d8f958906428dde30e44
4
+ data.tar.gz: 8ae7fa3fa6b99850410b81ad41044b46dd080051
5
+ SHA512:
6
+ metadata.gz: 7d521c40e32ec53b810a7b4a2158b0f1adc19708fecfccaec69140ca001609d5308a28e6d226700fa2a4a4d40b3d1b35e548baa5fa8e89d5756637d40de31c07
7
+ data.tar.gz: 39c2734db44734a35e6a4f2f7add58e0105ce50f164baadc6fe9574013b0c275cb329295709c2e86447d9b4410ca39e8a9f0f1d58054b5d277bb938c3d6354fd
@@ -1,5 +1,6 @@
1
1
  class SessionsController < ApplicationController
2
2
  skip_before_filter :ensure_authenticated
3
+ protect_from_forgery except: [:new, :create, :failure, :destroy]
3
4
 
4
5
  def new
5
6
  redirect_to '/auth/g'
@@ -19,6 +20,11 @@ class SessionsController < ApplicationController
19
20
  end
20
21
  end
21
22
 
23
+ def destroy
24
+ logout
25
+ redirect_to root_path
26
+ end
27
+
22
28
  def failure
23
29
  render :inline => 'Snowman says no. <div id="snowman" style="text-align:center; font-size:4000%;">&#9731;</div>'
24
30
  end
@@ -1,5 +1,6 @@
1
- GoogleAuth::Engine.routes.draw do
2
- match '/login', :to => 'sessions#new', :as => :login
3
- match '/auth/g/callback', :to => 'sessions#create'
4
- match '/auth/failure', :to => 'sessions#failure'
1
+ Rails.application.routes.draw do
2
+ get '/login', :to => 'sessions#new', :as => :login
3
+ post '/auth/g/callback', :to => 'sessions#create'
4
+ post '/auth/failure', :to => 'sessions#failure'
5
+ delete '/logout', :to => 'sessions#destroy', :as => :logout
5
6
  end
@@ -19,5 +19,10 @@ module GoogleAuth
19
19
  end
20
20
  end
21
21
 
22
+ def logout
23
+ session[:user_id] = nil
24
+ @current_user = nil
25
+ end
26
+
22
27
  end
23
28
  end
@@ -1,3 +1,3 @@
1
1
  module GoogleAuth
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,33 +1,30 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
5
- prerelease:
4
+ version: 0.0.4
6
5
  platform: ruby
7
6
  authors:
8
7
  - Burke Libbey
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-10-05 00:00:00.000000000 Z
11
+ date: 2014-04-28 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: omniauth-google-apps
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
- description: ! 'Convenience wrapper for omniauth-google-apps: Makes a lot of assumptions,
27
+ description: 'Convenience wrapper for omniauth-google-apps: Makes a lot of assumptions,
31
28
  requires less configuration.'
32
29
  email:
33
30
  - burke.libbey@shopify.com
@@ -48,26 +45,25 @@ files:
48
45
  - lib/google_auth/version.rb
49
46
  homepage: ''
50
47
  licenses: []
48
+ metadata: {}
51
49
  post_install_message:
52
50
  rdoc_options: []
53
51
  require_paths:
54
52
  - lib
55
53
  required_ruby_version: !ruby/object:Gem::Requirement
56
- none: false
57
54
  requirements:
58
- - - ! '>='
55
+ - - '>='
59
56
  - !ruby/object:Gem::Version
60
57
  version: '0'
61
58
  required_rubygems_version: !ruby/object:Gem::Requirement
62
- none: false
63
59
  requirements:
64
- - - ! '>='
60
+ - - '>='
65
61
  - !ruby/object:Gem::Version
66
62
  version: '0'
67
63
  requirements: []
68
64
  rubyforge_project:
69
- rubygems_version: 1.8.23
65
+ rubygems_version: 2.0.3
70
66
  signing_key:
71
- specification_version: 3
67
+ specification_version: 4
72
68
  summary: Convenience wrapper of omniauth-google-apps
73
69
  test_files: []