brightcontent-core 2.5.1 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 12c7f53b58837c974cbaa3aa92e6fa884e2ba2f3fdc264121ef1b2ef56dd324d
|
|
4
|
+
data.tar.gz: 7edc026e01dd198e6003a14e3105638ecba9504e1a2aa2b21911216b6b9440e5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4e0e2eef043e8f3ef0634f46f136fc37fb99ad944d3ee076c8cda9ffb6aca3f9c9e2efa868ca97767a6e0b24cea887ef5e6b73ba41acfc466fb94daa9f091c10
|
|
7
|
+
data.tar.gz: 92285171b581c06fba8317f1f6e925df39187d6a1e833dcaf188d5875caa07798aa70602003d6a8b1c752c771017467c1235367a52a7d45042c51c1a8217fa46
|
|
@@ -5,14 +5,14 @@ module Brightcontent
|
|
|
5
5
|
skip_before_action :authorize
|
|
6
6
|
|
|
7
7
|
def new
|
|
8
|
-
|
|
8
|
+
redirect_after_login if current_user
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def create
|
|
12
12
|
user = Brightcontent.user_model.authenticate(params[:email], params[:password])
|
|
13
13
|
if user
|
|
14
14
|
session[:brightcontent_user_id] = user.id
|
|
15
|
-
|
|
15
|
+
redirect_after_login
|
|
16
16
|
else
|
|
17
17
|
flash.now[:danger] = "Email or password is invalid"
|
|
18
18
|
render :new
|
|
@@ -21,7 +21,14 @@ module Brightcontent
|
|
|
21
21
|
|
|
22
22
|
def destroy
|
|
23
23
|
session[:brightcontent_user_id] = nil
|
|
24
|
+
session[:return_to] = nil
|
|
24
25
|
redirect_to root_url
|
|
25
26
|
end
|
|
27
|
+
|
|
28
|
+
private
|
|
29
|
+
|
|
30
|
+
def redirect_after_login
|
|
31
|
+
redirect_to session.delete(:return_to).presence || root_url
|
|
32
|
+
end
|
|
26
33
|
end
|
|
27
34
|
end
|
data/spec/features/login_spec.rb
CHANGED
|
@@ -27,6 +27,11 @@ feature "Login" do
|
|
|
27
27
|
page.should have_content "Please sign in"
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
+
scenario "Return to original page after logging in " do
|
|
31
|
+
sign_in "/admin/grouped_blogs"
|
|
32
|
+
current_url.should end_with "/admin/grouped_blogs"
|
|
33
|
+
end
|
|
34
|
+
|
|
30
35
|
def sign_in_with_invalid_email
|
|
31
36
|
@user = create(:admin_user)
|
|
32
37
|
visit "/admin"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: brightcontent-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Developers at Brightin
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-06-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|