16736: Replaces Time.now with db_current_time on token expiration handling code.
[arvados.git] / services / api / app / controllers / user_sessions_controller.rb
index da0523d2b0e54f01c24130b31e9f222c07a81889..8e9a26b7a88f3207c4ab1cb76f2aba990d6cce9c 100644 (file)
@@ -158,9 +158,9 @@ class UserSessionsController < ApplicationController
     end
     if Rails.configuration.Login.TokenLifetime > 0
       if token_expiration == nil
-        token_expiration = Time.now + Rails.configuration.Login.TokenLifetime
+        token_expiration = db_current_time + Rails.configuration.Login.TokenLifetime
       else
-        token_expiration = [token_expiration, Time.now + Rails.configuration.Login.TokenLifetime].min
+        token_expiration = [token_expiration, db_current_time + Rails.configuration.Login.TokenLifetime].min
       end
     end