Indentation

This commit is contained in:
Râu Cao 2023-07-14 15:29:04 +02:00
parent 12b24337e7
commit e11be727a1

View File

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