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: 80c40a35773f90ba2b88c6c7af72ffe90adcb9c5
4
- data.tar.gz: 930feb5ddb650ada9bbfe02c6cca9b065dcc92e5
3
+ metadata.gz: f688a3e6ddfdb194c5d439d6dbd1d36c0da636d7
4
+ data.tar.gz: d102f6ae10ac44258551d1cc0d0efb0fc06fb7db
5
5
  SHA512:
6
- metadata.gz: af280f95145ceafa64841d50e3efe63d311f027297ebc72d5bc1e46e4f80406b786baaa5a780acd380239e749f3be87576d481098d09f197c94b2e61b895e1ff
7
- data.tar.gz: 1eaf8e6473f391122c785e33692c03a9effc59ceb716a0c380344e25176a6c672fe4aa7ebe7aada5ec420d1a2587635914eb607a4cf129add8d726e6818d3cb3
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 Trestle.config.auth.remember.enabled && params[:remember_me] == "1"
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
@@ -1,5 +1,7 @@
1
1
  require "trestle/auth/version"
2
2
 
3
+ require "trestle"
4
+
3
5
  module Trestle
4
6
  module Auth
5
7
  extend ActiveSupport::Autoload
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Trestle
2
2
  module Auth
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
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.0
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-07-31 00:00:00.000000000 Z
11
+ date: 2017-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: trestle