Sha256: 4c5c9e30b2081b929bcdd556de48978b8ed52d68977b7560c1f83d809b5d9186
Contents?: true
Size: 704 Bytes
Versions: 8
Compression:
Stored size: 704 Bytes
Contents
# frozen_string_literal: true require 'securerandom' module Osso module Models class OauthClient < ActiveRecord::Base has_many :access_tokens has_many :refresh_tokens has_many :saml_providers has_many :redirect_uris before_validation :setup, on: :create validates :name, :secret, presence: true validates :identifier, presence: true, uniqueness: true def default_redirect_uri redirect_uris.find(&:primary) end def redirect_uri_values redirect_uris.map(&:uri) end private def setup self.identifier = SecureRandom.hex(16) self.secret = SecureRandom.hex(64) end end end end
Version data entries
8 entries across 8 versions & 1 rubygems