challah 1.2.8 → 1.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/sessions_controller.rb +35 -33
- data/lib/challah/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55b927f07b2b2a7d010ec6c193367b44558d9a14
|
4
|
+
data.tar.gz: 968f3c0825495e1d5fb765fa61e1b475eaeb8bf6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00cb5a947fd5e91283c96130479e07b0d6036966907e82139350fe789e22f816e3cdc62e2e87e86585511a14db9a36a924ae9d11bfd6be6d68ee43ba02f5f26c
|
7
|
+
data.tar.gz: b7ee6e3c9d23b1afef33fa65f356d7645146b4bcb8f5ada466078ea32a2fca2c208b69263c6e5e153a02e2d8ed72e771c530c224f843880fa3f16cb55d9bb165
|
@@ -1,42 +1,44 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
if defined?(ApplicationController)
|
2
|
+
class SessionsController < ApplicationController
|
3
|
+
before_filter :destroy_session, except: :create
|
3
4
|
|
4
|
-
|
5
|
+
unloadable
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
# POST /login
|
13
|
-
# POST /sign-in
|
14
|
-
def create
|
15
|
-
@session = Challah::Session.new(request, params[:session])
|
16
|
-
@session.ip = request.remote_ip
|
7
|
+
# GET /login
|
8
|
+
# GET /sign-in
|
9
|
+
def new
|
10
|
+
@session = Challah::Session.new(request)
|
11
|
+
end
|
17
12
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
13
|
+
# POST /login
|
14
|
+
# POST /sign-in
|
15
|
+
def create
|
16
|
+
@session = Challah::Session.new(request, params[:session])
|
17
|
+
@session.ip = request.remote_ip
|
18
|
+
|
19
|
+
if @session.save
|
20
|
+
redirect_to return_to_path
|
21
|
+
else
|
22
|
+
redirect_to signin_path, alert: I18n.translate('sessions.create.failed_login')
|
23
|
+
end
|
22
24
|
end
|
23
|
-
end
|
24
25
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
26
|
+
# GET /logout
|
27
|
+
# GET /sign-out
|
28
|
+
def destroy
|
29
|
+
redirect_to signin_path
|
30
|
+
end
|
30
31
|
|
31
|
-
|
32
|
+
protected
|
32
33
|
|
33
|
-
|
34
|
-
|
35
|
-
|
34
|
+
def destroy_session
|
35
|
+
current_user_session.destroy
|
36
|
+
end
|
36
37
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
38
|
+
def return_to_path(default_path = '/')
|
39
|
+
result = session[:return_to]
|
40
|
+
result = nil if result and result == "http://#{request.domain}/"
|
41
|
+
result || default_path
|
42
|
+
end
|
41
43
|
end
|
42
|
-
end
|
44
|
+
end
|
data/lib/challah/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: challah
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Tornow
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-
|
13
|
+
date: 2015-09-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: highline
|