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.
- data/README.markdown +1 -1
- data/VERSION.yml +3 -3
- data/app/controllers/sessions_controller.rb +2 -2
- data/lib/twitter_auth/controller_extensions.rb +10 -7
- metadata +3 -3
data/README.markdown
CHANGED
@@ -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
|
5
|
+
This was a proof of concept for using them together. Really very little needed to be changed.
|
data/VERSION.yml
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
---
|
2
|
-
:patch:
|
3
|
-
:major:
|
4
|
-
:minor:
|
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
|
-
|
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
|
-
|
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
|
-
|
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:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michael Bleigh, Keith Norman and Allison Liechty
|