From 3bc683be8f9c983161d24ca22076ab74af60a644 Mon Sep 17 00:00:00 2001 From: Jure Grabnar Date: Thu, 29 Sep 2016 10:57:08 +0200 Subject: [PATCH] Fix access_token_ttl calculation --- app/models/user.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index c34060677..5e67ee19e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -266,11 +266,11 @@ class User < ActiveRecord::Base # If current token is not valid generate a new one with a one day TTL self.wopi_token = Devise.friendly_token(20) # WOPI uses millisecond TTLs - self.wopi_token_ttl = Time.now.to_i + 1.days + self.wopi_token_ttl = (Time.now + 1.days).to_i save - Rails.logger.warn("Generating new token #{wopi_token}") + Rails.logger.warn("WOPI: generating new token #{wopi_token}") end - Rails.logger.warn("Returning token #{wopi_token}") + Rails.logger.warn("WOPI: returning token #{wopi_token}") wopi_token end