X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/32926d6543e52daa4db8e47c2870bef4d6bdf71d..e49ad3dfe5092d2a5f2371aba4d6005a54af36a0:/services/api/script/get_anonymous_user_token.rb diff --git a/services/api/script/get_anonymous_user_token.rb b/services/api/script/get_anonymous_user_token.rb index 141f74651c..6964af0b63 100755 --- a/services/api/script/get_anonymous_user_token.rb +++ b/services/api/script/get_anonymous_user_token.rb @@ -21,15 +21,13 @@ get_existing = opts[:get] require File.dirname(__FILE__) + '/../config/environment' include ApplicationHelper -include DbCurrentTime - act_as_system_user def create_api_client_auth api_client_auth = ApiClientAuthorization. new(user: anonymous_user, api_client_id: 0, - expires_at: db_current_time + 100.years, + expires_at: Time.now + 100.years, scopes: ['GET /']) api_client_auth.save! api_client_auth.reload @@ -38,7 +36,7 @@ end if get_existing api_client_auth = ApiClientAuthorization. where('user_id=?', anonymous_user.id.to_i). - where('expires_at>?', db_current_time). + where('expires_at>?', Time.now). select { |auth| auth.scopes == ['GET /'] }. first end