From d71c054f1ecda8fe5b71e808d324ab5ad74111b2 Mon Sep 17 00:00:00 2001 From: Roman Date: Fri, 12 Jan 2018 19:31:07 +0200 Subject: [PATCH] Make confirmable not dependant on trackable (#1064) --- app/controllers/devise_token_auth/confirmations_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/devise_token_auth/confirmations_controller.rb b/app/controllers/devise_token_auth/confirmations_controller.rb index c129a485d..8ecfddd07 100644 --- a/app/controllers/devise_token_auth/confirmations_controller.rb +++ b/app/controllers/devise_token_auth/confirmations_controller.rb @@ -10,7 +10,7 @@ def show token_hash = BCrypt::Password.create(token) expiry = (Time.now + @resource.token_lifespan).to_i - if @resource.sign_in_count > 0 + if defined? @resource.sign_in_count && @resource.sign_in_count > 0 expiry = (Time.now + 1.second).to_i end