remoteStorage OAuth #109

Merged
raucao merged 24 commits from feature/rs-oauth into master 2023-08-04 08:55:29 +00:00
Showing only changes of commit e11be727a1 - Show all commits

View File

@@ -35,17 +35,17 @@ class RemoteStorageAuthorization < ApplicationRecord
private
def redis
@redis ||= Redis.new(url: Setting.redis_url)
end
def redis
@redis ||= Redis.new(url: Setting.rs_redis_url)
end
def generate_token(length=16)
self.token = SecureRandom.hex(length) if self.token.blank?
end
def generate_token(length=16)
self.token = SecureRandom.hex(length) if self.token.blank?
end
def store_token_in_redis
redis.sadd "rs:authorizations:#{user.address}:#{token}", permissions
end
def store_token_in_redis
redis.sadd "rs:authorizations:#{user.address}:#{token}", permissions
end
def schedule_token_expiry
return unless expire_at.present?