bootstrap_devise_base 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +54 -0
- data/Gemfile.lock +237 -0
- data/Rakefile +7 -0
- data/app/.svn/all-wcprops +5 -0
- data/app/.svn/entries +31 -0
- data/app/assets/images/rails.png +0 -0
- data/app/assets/javascripts/application.js +16 -0
- data/app/assets/javascripts/registrations.js.coffee +3 -0
- data/app/assets/stylesheets/application.css +23 -0
- data/app/assets/stylesheets/bootstrap.scss +29 -0
- data/app/assets/stylesheets/forms.scss +481 -0
- data/app/assets/stylesheets/mixins.scss +220 -0
- data/app/assets/stylesheets/patterns.scss +1061 -0
- data/app/assets/stylesheets/registrations.css.scss +3 -0
- data/app/assets/stylesheets/reset.scss +144 -0
- data/app/assets/stylesheets/scaffolding.scss +144 -0
- data/app/assets/stylesheets/tables.scss +226 -0
- data/app/assets/stylesheets/type.scss +190 -0
- data/app/assets/stylesheets/variables.scss +60 -0
- data/app/controllers/.svn/all-wcprops +11 -0
- data/app/controllers/.svn/entries +62 -0
- data/app/controllers/.svn/text-base/assets_offline_controller.rb.svn-base +85 -0
- data/app/controllers/application_controller.rb +6 -0
- data/app/controllers/authentications_controller.rb +34 -0
- data/app/controllers/home_controller.rb +83 -0
- data/app/controllers/registrations_controller.rb +18 -0
- data/app/helpers/application_helper.rb +2 -0
- data/app/helpers/authentications_helper.rb +2 -0
- data/app/helpers/devise_helper.rb +29 -0
- data/app/helpers/home_helper.rb +2 -0
- data/app/helpers/registrations_helper.rb +2 -0
- data/app/mailers/.gitkeep +0 -0
- data/app/models/.gitkeep +0 -0
- data/app/models/authentication.rb +3 -0
- data/app/models/user.rb +20 -0
- data/app/views/authentications/_form.html.erb +16 -0
- data/app/views/authentications/edit.html.erb +8 -0
- data/app/views/authentications/index.html.erb +22 -0
- data/app/views/authentications/new.html.erb +5 -0
- data/app/views/authentications/show.html.erb +20 -0
- data/app/views/devise/confirmations/new.html.erb +12 -0
- data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/devise/passwords/edit.html.erb +16 -0
- data/app/views/devise/passwords/new.html.erb +12 -0
- data/app/views/devise/sessions/new.html.erb +58 -0
- data/app/views/devise/shared/_links.erb +25 -0
- data/app/views/devise/unlocks/new.html.erb +12 -0
- data/app/views/home/_form.html.erb +17 -0
- data/app/views/home/edit.html.erb +6 -0
- data/app/views/home/index.html.erb +21 -0
- data/app/views/home/new.html.erb +5 -0
- data/app/views/home/show.html.erb +5 -0
- data/app/views/layouts/application.html.erb +112 -0
- data/app/views/registrations/edit.html.erb +25 -0
- data/app/views/registrations/new.html.erb +47 -0
- data/bootstrap_devise_base.gemspec +20 -0
- data/config.ru +4 -0
- data/config/.svn/all-wcprops +11 -0
- data/config/.svn/entries +62 -0
- data/config/.svn/text-base/routes.rb.svn-base +3 -0
- data/config/application.rb +48 -0
- data/config/boot.rb +6 -0
- data/config/cucumber.yml +8 -0
- data/config/database.yml +45 -0
- data/config/environment.rb +5 -0
- data/config/environments/development.rb +30 -0
- data/config/environments/production.rb +60 -0
- data/config/environments/test.rb +39 -0
- data/config/initializers/backtrace_silencers.rb +7 -0
- data/config/initializers/devise.rb +208 -0
- data/config/initializers/inflections.rb +10 -0
- data/config/initializers/mime_types.rb +5 -0
- data/config/initializers/omniauth.rb +3 -0
- data/config/initializers/secret_token.rb +7 -0
- data/config/initializers/session_store.rb +8 -0
- data/config/initializers/wrap_parameters.rb +14 -0
- data/config/locales/devise.en.yml +58 -0
- data/config/locales/en.yml +13 -0
- data/config/routes.rb +64 -0
- data/db/migrate/20111121201415_create_users.rb +8 -0
- data/db/migrate/20111121201511_add_devise_to_users.rb +31 -0
- data/db/migrate/20111127100158_create_authentications.rb +14 -0
- data/db/schema.rb +42 -0
- data/db/seeds.rb +7 -0
- data/doc/README_FOR_APP +2 -0
- data/features/manage_sign_ups.feature +28 -0
- data/features/step_definitions/sign_up_steps.rb +27 -0
- data/features/step_definitions/web_steps.rb +254 -0
- data/features/support/env.rb +56 -0
- data/features/support/paths.rb +39 -0
- data/features/support/selectors.rb +39 -0
- data/init.rb +1 -0
- data/lib/.svn/all-wcprops +11 -0
- data/lib/.svn/entries +65 -0
- data/lib/.svn/text-base/assets_offline.rb.svn-base +6 -0
- data/lib/assets/.gitkeep +0 -0
- data/lib/bootstap_devise_base.rb~ +6 -0
- data/lib/bootstrap_devise_base.rb +6 -0
- data/lib/bootstrap_devise_base/.svn/all-wcprops +11 -0
- data/lib/bootstrap_devise_base/.svn/entries +62 -0
- data/lib/bootstrap_devise_base/.svn/text-base/version.rb.svn-base +3 -0
- data/lib/bootstrap_devise_base/version.rb +3 -0
- data/lib/tasks/.gitkeep +0 -0
- data/lib/tasks/cucumber.rake +65 -0
- data/log/.gitkeep +0 -0
- data/log/development.log +977 -0
- data/log/production.log +44 -0
- data/log/test.log +799 -0
- data/public/404.html +26 -0
- data/public/422.html +26 -0
- data/public/500.html +26 -0
- data/public/assets/application-902e25928a309d43246c45cd2facd7d3.js +19 -0
- data/public/assets/application-902e25928a309d43246c45cd2facd7d3.js.gz +0 -0
- data/public/assets/application-a5e3fc47c863d5a64c7380ed33b187b6.css +1 -0
- data/public/assets/application-a5e3fc47c863d5a64c7380ed33b187b6.css.gz +0 -0
- data/public/assets/application.css +1 -0
- data/public/assets/application.css.gz +0 -0
- data/public/assets/application.js +19 -0
- data/public/assets/application.js.gz +0 -0
- data/public/assets/manifest.yml +4 -0
- data/public/assets/rails-e4b51606cd77fda2615e7439907bfc92.png +0 -0
- data/public/assets/rails.png +0 -0
- data/public/favicon.ico +0 -0
- data/public/robots.txt +5 -0
- data/script/cucumber +10 -0
- data/script/rails +6 -0
- data/test/fixtures/.gitkeep +0 -0
- data/test/functional/.gitkeep +0 -0
- data/test/integration/.gitkeep +0 -0
- data/test/performance/browsing_test.rb +12 -0
- data/test/test_helper.rb +13 -0
- data/test/unit/.gitkeep +0 -0
- data/vendor/assets/stylesheets/.gitkeep +0 -0
- data/vendor/plugins/.gitkeep +0 -0
- metadata +181 -0
@@ -0,0 +1,190 @@
|
|
1
|
+
/* Typography.scss
|
2
|
+
* Headings, body text, lists, code, and more for a versatile and durable typography system
|
3
|
+
* ---------------------------------------------------------------------------------------- */
|
4
|
+
|
5
|
+
// Core
|
6
|
+
@import "variables.scss";
|
7
|
+
@import "mixins.scss";
|
8
|
+
|
9
|
+
// BODY TEXT
|
10
|
+
// ---------
|
11
|
+
|
12
|
+
p {
|
13
|
+
@include shorthand-font(normal,$basefont,$baseline);
|
14
|
+
margin-bottom: $baseline / 2;
|
15
|
+
small {
|
16
|
+
font-size: $basefont - 2;
|
17
|
+
color: $grayLight;
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
|
22
|
+
// HEADINGS
|
23
|
+
// --------
|
24
|
+
|
25
|
+
h1, h2, h3, h4, h5, h6 {
|
26
|
+
font-weight: bold;
|
27
|
+
color: $grayDark;
|
28
|
+
small {
|
29
|
+
color: $grayLight;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
h1 {
|
33
|
+
margin-bottom: $baseline;
|
34
|
+
font-size: 30px;
|
35
|
+
line-height: $baseline * 2;
|
36
|
+
small {
|
37
|
+
font-size: 18px;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
h2 {
|
41
|
+
font-size: 24px;
|
42
|
+
line-height: $baseline * 2;
|
43
|
+
small {
|
44
|
+
font-size: 14px;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
h3, h4, h5, h6 {
|
48
|
+
line-height: $baseline * 2;
|
49
|
+
}
|
50
|
+
h3 {
|
51
|
+
font-size: 18px;
|
52
|
+
small {
|
53
|
+
font-size: 14px;
|
54
|
+
}
|
55
|
+
}
|
56
|
+
h4 {
|
57
|
+
font-size: 16px;
|
58
|
+
small {
|
59
|
+
font-size: 12px;
|
60
|
+
}
|
61
|
+
}
|
62
|
+
h5 {
|
63
|
+
font-size: 14px;
|
64
|
+
}
|
65
|
+
h6 {
|
66
|
+
font-size: 13px;
|
67
|
+
color: $grayLight;
|
68
|
+
text-transform: uppercase;
|
69
|
+
}
|
70
|
+
|
71
|
+
|
72
|
+
// COLORS
|
73
|
+
// ------
|
74
|
+
|
75
|
+
// Unordered and Ordered lists
|
76
|
+
ul, ol {
|
77
|
+
margin: 0 0 $baseline 25px;
|
78
|
+
}
|
79
|
+
ul ul,
|
80
|
+
ul ol,
|
81
|
+
ol ol,
|
82
|
+
ol ul {
|
83
|
+
margin-bottom: 0;
|
84
|
+
}
|
85
|
+
ul {
|
86
|
+
list-style: disc;
|
87
|
+
}
|
88
|
+
ol {
|
89
|
+
list-style: decimal;
|
90
|
+
}
|
91
|
+
li {
|
92
|
+
line-height: $baseline;
|
93
|
+
color: $gray;
|
94
|
+
}
|
95
|
+
ul.unstyled {
|
96
|
+
list-style: none;
|
97
|
+
margin-left: 0;
|
98
|
+
}
|
99
|
+
|
100
|
+
// Description Lists
|
101
|
+
dl {
|
102
|
+
margin-bottom: $baseline;
|
103
|
+
dt, dd {
|
104
|
+
line-height: $baseline;
|
105
|
+
}
|
106
|
+
dt {
|
107
|
+
font-weight: bold;
|
108
|
+
}
|
109
|
+
dd {
|
110
|
+
margin-left: $baseline / 2;
|
111
|
+
}
|
112
|
+
}
|
113
|
+
|
114
|
+
// MISC
|
115
|
+
// ----
|
116
|
+
|
117
|
+
// Horizontal rules
|
118
|
+
hr {
|
119
|
+
margin: 20px 0 19px;
|
120
|
+
border: 0;
|
121
|
+
border-bottom: 1px solid #eee;
|
122
|
+
}
|
123
|
+
|
124
|
+
// Emphasis
|
125
|
+
strong {
|
126
|
+
font-style: inherit;
|
127
|
+
font-weight: bold;
|
128
|
+
}
|
129
|
+
em {
|
130
|
+
font-style: italic;
|
131
|
+
font-weight: inherit;
|
132
|
+
line-height: inherit;
|
133
|
+
}
|
134
|
+
.muted {
|
135
|
+
color: $grayLight;
|
136
|
+
}
|
137
|
+
|
138
|
+
// Blockquotes
|
139
|
+
blockquote {
|
140
|
+
margin-bottom: $baseline;
|
141
|
+
border-left: 5px solid #eee;
|
142
|
+
padding-left: 15px;
|
143
|
+
p {
|
144
|
+
@include shorthand-font(300,14px,$baseline);
|
145
|
+
margin-bottom: 0;
|
146
|
+
}
|
147
|
+
small {
|
148
|
+
display: block;
|
149
|
+
@include shorthand-font(300,12px,$baseline);
|
150
|
+
color: $grayLight;
|
151
|
+
&:before {
|
152
|
+
content: '\2014 \00A0';
|
153
|
+
}
|
154
|
+
}
|
155
|
+
}
|
156
|
+
|
157
|
+
// Addresses
|
158
|
+
address {
|
159
|
+
display: block;
|
160
|
+
line-height: $baseline;
|
161
|
+
margin-bottom: $baseline;
|
162
|
+
}
|
163
|
+
|
164
|
+
// Inline and block code styles
|
165
|
+
code, pre {
|
166
|
+
padding: 0 3px 2px;
|
167
|
+
font-family: Monaco, Andale Mono, Courier New, monospace;
|
168
|
+
font-size: 12px;
|
169
|
+
@include border-radius(3px);
|
170
|
+
}
|
171
|
+
code {
|
172
|
+
background-color: lighten($orange, 40%);
|
173
|
+
color: rgba(0,0,0,.75);
|
174
|
+
padding: 1px 3px;
|
175
|
+
}
|
176
|
+
pre {
|
177
|
+
background-color: #f5f5f5;
|
178
|
+
display: block;
|
179
|
+
padding: ($baseline - 1) / 2;
|
180
|
+
margin: 0 0 $baseline;
|
181
|
+
line-height: $baseline;
|
182
|
+
font-size: 12px;
|
183
|
+
border: 1px solid #ccc;
|
184
|
+
border: 1px solid rgba(0,0,0,.15);
|
185
|
+
@include border-radius(3px);
|
186
|
+
white-space: pre;
|
187
|
+
white-space: pre-wrap;
|
188
|
+
word-wrap: break-word;
|
189
|
+
|
190
|
+
}
|
@@ -0,0 +1,60 @@
|
|
1
|
+
/* variables.scss
|
2
|
+
* Variables and mixins to pre-ignite any new web development project
|
3
|
+
* ------------------------------------------------------------------ */
|
4
|
+
|
5
|
+
|
6
|
+
// Links
|
7
|
+
$linkColor: #0069d6;
|
8
|
+
$linkColorHover: darken($linkColor, 15);
|
9
|
+
|
10
|
+
// Grays
|
11
|
+
$black: #000;
|
12
|
+
$grayDark: lighten($black, 25%);
|
13
|
+
$gray: lighten($black, 50%);
|
14
|
+
$grayLight: lighten($black, 75%);
|
15
|
+
$grayLighter: lighten($black, 90%);
|
16
|
+
$white: #fff;
|
17
|
+
|
18
|
+
// Accent Colors
|
19
|
+
$blue: #049CDB;
|
20
|
+
$blueDark: #0064CD;
|
21
|
+
$green: #46a546;
|
22
|
+
$red: #9d261d;
|
23
|
+
$yellow: #ffc40d;
|
24
|
+
$orange: #f89406;
|
25
|
+
$pink: #c3325f;
|
26
|
+
$purple: #7a43b6;
|
27
|
+
|
28
|
+
// Baseline grid
|
29
|
+
$basefont: 13px;
|
30
|
+
$baseline: 18px;
|
31
|
+
|
32
|
+
// Griditude
|
33
|
+
// Modify the grid styles in mixins.scss
|
34
|
+
$gridColumns: 16;
|
35
|
+
$gridColumnWidth: 40px;
|
36
|
+
$gridGutterWidth: 20px;
|
37
|
+
$extraSpace: ($gridGutterWidth * 2); // For our grid calculations
|
38
|
+
$siteWidth: ($gridColumns * $gridColumnWidth) + ($gridGutterWidth * ($gridColumns - 1));
|
39
|
+
|
40
|
+
// Color Scheme
|
41
|
+
// Use this to roll your own color schemes if you like (unused by Bootstrap by default)
|
42
|
+
$baseColor: $blue; // Set a base color
|
43
|
+
$complement: complement($baseColor); // Determine a complementary color
|
44
|
+
$split1: adjust-hue($baseColor, 158); // Split complements
|
45
|
+
$split2: adjust-hue($baseColor, -158);
|
46
|
+
$triad1: adjust-hue($baseColor, 135); // Triads colors
|
47
|
+
$triad2: adjust-hue($baseColor, -135);
|
48
|
+
$tetra1: adjust-hue($baseColor, 90); // Tetra colors
|
49
|
+
$tetra2: adjust-hue($baseColor, -90);
|
50
|
+
$analog1: adjust-hue($baseColor, 22); // Analogs colors
|
51
|
+
$analog2: adjust-hue($baseColor, -22);
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
// More variables coming soon:
|
56
|
+
// - @basefont to @baseFontSize
|
57
|
+
// - @baseline to @baseLineHeight
|
58
|
+
// - @baseFontFamily
|
59
|
+
// - @primaryButtonColor
|
60
|
+
// - anything else? File an issue on GitHub
|
@@ -0,0 +1,11 @@
|
|
1
|
+
K 25
|
2
|
+
svn:wc:ra_dav:version-url
|
3
|
+
V 68
|
4
|
+
/svn/TorexNG/!svn/ver/3734/trunk/gems/assets_offline/app/controllers
|
5
|
+
END
|
6
|
+
assets_offline_controller.rb
|
7
|
+
K 25
|
8
|
+
svn:wc:ra_dav:version-url
|
9
|
+
V 97
|
10
|
+
/svn/TorexNG/!svn/ver/3734/trunk/gems/assets_offline/app/controllers/assets_offline_controller.rb
|
11
|
+
END
|
@@ -0,0 +1,62 @@
|
|
1
|
+
10
|
2
|
+
|
3
|
+
dir
|
4
|
+
3734
|
5
|
+
https://svn.torex.com/svn/TorexNG/trunk/gems/assets_offline/app/controllers
|
6
|
+
https://svn.torex.com/svn/TorexNG
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
2011-12-02T15:46:33.442319Z
|
11
|
+
3734
|
12
|
+
Anthony.Broome
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
45178cb0-7fed-444c-b58d-06e1424a9ccb
|
28
|
+
|
29
|
+
assets_offline_controller.rb
|
30
|
+
file
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
2011-12-02T14:38:49.402396Z
|
36
|
+
fa45977fe7a847e4fa4be00ea5d80b3d
|
37
|
+
2011-12-02T15:46:33.442319Z
|
38
|
+
3734
|
39
|
+
Anthony.Broome
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
2490
|
62
|
+
|
@@ -0,0 +1,85 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
3
|
+
class AssetsOfflineController < ActionController::Base
|
4
|
+
|
5
|
+
def show
|
6
|
+
config = YAML.load_file("#{Rails.root}/config/assets_offline.yml")
|
7
|
+
root = config[params[:id]]
|
8
|
+
|
9
|
+
body = "# GENERATED USING ASSET_OFFLINE\n"
|
10
|
+
body << "# Mode: #{Rails.env} \n"
|
11
|
+
body << "# #{generate_key()} \n\n"
|
12
|
+
|
13
|
+
body << "CACHE MANIFEST \n"
|
14
|
+
# CACHE SECTION
|
15
|
+
if !root["asset-cache"].blank? and root["asset-cache"].count() > 0
|
16
|
+
root["asset-cache"].each do |asset_name|
|
17
|
+
body << "#{view_context.asset_path(asset_name)}\n"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
if !root["cache"].blank? and root["cache"].count() > 0
|
21
|
+
root["cache"].each do |asset_name|
|
22
|
+
body << "#{asset_name}\n"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
body << "\n"
|
26
|
+
|
27
|
+
# NETWORK SECTION
|
28
|
+
body << "NETWORK:\n"
|
29
|
+
body << "# Resources where a connection is required \n"
|
30
|
+
if !root["asset-network"].blank? and root["asset-network"].count() > 0
|
31
|
+
root["asset-network"].each do |asset_name|
|
32
|
+
body << "#{view_context.asset_path(asset_name)}\n"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
if !root["network"].blank? and root["network"].count() > 0
|
36
|
+
root["network"].each do |asset_name|
|
37
|
+
body << "#{asset_name}\n"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
body << "\n"
|
41
|
+
|
42
|
+
#FALLBACK SECTION
|
43
|
+
body << "FALLBACK:\n"
|
44
|
+
body << "# Resources where a connection is used if available \n"
|
45
|
+
if !root["asset-fallback"].blank? and root["asset-fallback"].count() > 0
|
46
|
+
root["asset-fallback"].each do |asset_name|
|
47
|
+
asset_name_part = asset_name.split("#")
|
48
|
+
body << "#{view_context.asset_path(asset_name_part[0].strip())} #{view_context.asset_path(asset_name_part[1].strip())}\n"
|
49
|
+
end
|
50
|
+
end
|
51
|
+
if !root["fallback"].blank? and root["fallback"].count() > 0
|
52
|
+
root["fallback"].each do |asset_name|
|
53
|
+
asset_name_part = asset_name.split("#")
|
54
|
+
body << "#{asset_name_part[0].strip()} #{asset_name_part[1].strip()}\n"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
body << "\n"
|
58
|
+
|
59
|
+
headers['Content-Type'] = 'text/cache-manifest'
|
60
|
+
render :text => body, :layout => false
|
61
|
+
end
|
62
|
+
|
63
|
+
private
|
64
|
+
|
65
|
+
def generate_key
|
66
|
+
if Rails.env.production?
|
67
|
+
production_key
|
68
|
+
else
|
69
|
+
development_key
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
|
+
|
74
|
+
def production_key
|
75
|
+
#Invalidate production by updating the datetime stamp in the comment
|
76
|
+
path = "#{Rails.root}/config/assets_offline.yml"
|
77
|
+
Digest::SHA2.hexdigest(File.read(path)) if ::File.file?(path)
|
78
|
+
end
|
79
|
+
|
80
|
+
def development_key
|
81
|
+
now = Time.now.to_i - Time.now.to_i % 5
|
82
|
+
Digest::SHA2.hexdigest(now.to_s)
|
83
|
+
end
|
84
|
+
|
85
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
class AuthenticationsController < ApplicationController
|
2
|
+
def index
|
3
|
+
@authentications = current_user.authentications if current_user
|
4
|
+
end
|
5
|
+
|
6
|
+
def create
|
7
|
+
omniauth = request.env["omniauth.auth"]
|
8
|
+
authentication = Authentication.find_by_provider_and_uid(omniauth['provider'], omniauth['uid'])
|
9
|
+
if authentication
|
10
|
+
flash[:notice] = "Signed in successfully."
|
11
|
+
sign_in_and_redirect(:user, authentication.user)
|
12
|
+
elsif current_user
|
13
|
+
current_user.authentications.create!(:provider => omniauth['provider'], :uid => omniauth['uid'])
|
14
|
+
flash[:notice] = "Authentication successful"
|
15
|
+
redirect_to authentications_url
|
16
|
+
else
|
17
|
+
user = User.new
|
18
|
+
user.apply_omniauth(omniauth)
|
19
|
+
if user.save
|
20
|
+
flash[:notice] = "Signed in successfully."
|
21
|
+
sign_in_and_redirect(:user, user)
|
22
|
+
else
|
23
|
+
session[:omniauth] = omniauth.except('extra')
|
24
|
+
redirect_to new_user_registration_url
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def destroy
|
30
|
+
@authentication = current_user.authentications.find(params[:id])
|
31
|
+
@authentication.destroy
|
32
|
+
redirect_to authentications_url, :notice => "Successfully destroyed authentication."
|
33
|
+
end
|
34
|
+
end
|