From adc6b7d0ef82df246e6bc19271f6a09a335f0a08 Mon Sep 17 00:00:00 2001 From: Gavin Brock Date: Tue, 7 Feb 2012 14:24:39 +0900 Subject: [PATCH] Updated AccessGrant so timeout now matches AuthController's access_tokens life --- app/models/access_grant.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/models/access_grant.rb b/app/models/access_grant.rb index 0df90ae..3d0cf37 100644 --- a/app/models/access_grant.rb +++ b/app/models/access_grant.rb @@ -24,10 +24,8 @@ def redirect_uri_for(redirect_uri) end end - # Note: This is currently hard coded to 2 days, but it could be configurable - # per-user-type or per-application. - # No need for this to be constant like this. + # Note: This is currently configured through devise, and matches the AuthController access token life def start_expiry_period! - self.update_attribute(:access_token_expires_at, 2.days.from_now) + self.update_attribute(:access_token_expires_at, Time.now + Devise.timeout_in) end end