trestle-auth 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f688a3e6ddfdb194c5d439d6dbd1d36c0da636d7
|
4
|
+
data.tar.gz: d102f6ae10ac44258551d1cc0d0efb0fc06fb7db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5ebdbca43f108eafb6d3e49b4702a87caa6c06f3f7aa51de9ceeadbed5b94ab6a1605f396ca2660121d1a78492d7787ca1a362e9091ede6f81cb7f6db6aa87a
|
7
|
+
data.tar.gz: a52411f8cc84950aea12bdccb73ca6fccf8a28153d53a3402be0f80a11c54f90ab0d550480a235b0b70b8c44e0e243b4efa16cbe2d1c571c50e0f3004449739e
|
@@ -9,7 +9,7 @@ class Trestle::Auth::SessionsController < Trestle::ApplicationController
|
|
9
9
|
def create
|
10
10
|
if user = Trestle.config.auth.authenticate(params)
|
11
11
|
login!(user)
|
12
|
-
remember_me! if
|
12
|
+
remember_me! if params[:remember_me] == "1"
|
13
13
|
redirect_to previous_location || Trestle.config.path
|
14
14
|
else
|
15
15
|
flash[:error] = t("admin.auth.error", default: "Incorrect login details.")
|
data/lib/trestle/auth.rb
CHANGED
@@ -57,11 +57,13 @@ module Trestle
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def remember_me!
|
60
|
+
return unless Trestle.config.auth.remember.enabled
|
60
61
|
Trestle.config.auth.remember.remember_me(current_user)
|
61
62
|
cookies.signed[:trestle_remember_token] = Trestle.config.auth.remember.cookie(current_user)
|
62
63
|
end
|
63
64
|
|
64
65
|
def forget_me!
|
66
|
+
return unless Trestle.config.auth.remember.enabled
|
65
67
|
Trestle.config.auth.remember.forget_me(current_user) if logged_in?
|
66
68
|
cookies.delete(:trestle_remember_token)
|
67
69
|
end
|
data/lib/trestle/auth/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trestle-auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Pohlenz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: trestle
|