twitter-auth-with-mongo-mapper 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,4 +2,4 @@ TwitterAuth is an awesome gem written by mbleigh, which you can check out [here]
2
2
 
3
3
  MongoMapper is an awesome gem written by jnunemaker, which you can check out [here](http://github.com/jnunemaker).
4
4
 
5
- This began as a proof of concept of putting the two together, but it is slowly becoming a full-fledged auth strategy. It's rough and undocumented now, so use at your own risk, but more features and clear documentation are coming.
5
+ This was a proof of concept for using them together. Really very little needed to be changed.
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 0
3
- :major: 1
4
- :minor: 0
2
+ :patch: 1
3
+ :major: 0
4
+ :minor: 1
@@ -48,7 +48,7 @@ class SessionsController < ApplicationController
48
48
  @user = User.identify_or_create_from_access_token(@access_token)
49
49
 
50
50
  if @user.onboard_status == 0
51
- authentication_failed("You need to be vowched for before you can sign up.")
51
+ authentication_failed_need_vowch("You need to be vowched for before you can sign up.")
52
52
  elsif @user.onboard_status == 1
53
53
  @user.update_attributes(:onboard_status => 2)
54
54
  session[:user_id] = @user.id
@@ -76,6 +76,6 @@ class SessionsController < ApplicationController
76
76
 
77
77
  def destroy
78
78
  logout_keeping_session!
79
- redirect_back_or_default('/')
79
+ redirect_to root_url
80
80
  end
81
81
  end
@@ -9,7 +9,12 @@ module TwitterAuth
9
9
 
10
10
  protected
11
11
 
12
- def authentication_failed(message, destination='/')
12
+ def authentication_failed(message, destination="/need-a-vowch")
13
+ flash[:error] = message
14
+ redirect_to destination
15
+ end
16
+
17
+ def authentication_failed_need_vowch(message, destination="/need-a-vowch")
13
18
  flash[:error] = message
14
19
  redirect_to destination
15
20
  end
@@ -19,9 +24,9 @@ module TwitterAuth
19
24
  redirect_back_or_default destination
20
25
  end
21
26
 
22
- def onboard_user(message = 'Welcome to Vowch!', destination='/')
23
- flash[:notice] = message
24
- redirect_back_or_default destination
27
+ def onboard_user(message = 'Welcome to Vowch!', destination='/complete-sign-up')
28
+ #flash[:notice] = message
29
+ redirect_to destination
25
30
  end
26
31
 
27
32
  def current_user
@@ -44,15 +49,13 @@ module TwitterAuth
44
49
  session[:user_id] = new_user.id
45
50
  @current_user = new_user
46
51
  end
47
-
52
+
48
53
  def authorized?
49
54
  !!current_user
50
55
  end
51
-
52
56
  def login_required
53
57
  authorized? || access_denied
54
58
  end
55
-
56
59
  def access_denied
57
60
  store_location
58
61
  redirect_to login_path
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitter-auth-with-mongo-mapper
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Bleigh, Keith Norman and Allison Liechty