mirror of
https://github.com/System-End/theseus.git
synced 2026-04-19 19:55:10 +00:00
add max length to public api keys
This commit is contained in:
parent
2f7d25f9de
commit
c98a91d1f0
1 changed files with 1 additions and 0 deletions
|
|
@ -25,6 +25,7 @@ class Public::APIKey < ApplicationRecord
|
|||
belongs_to :public_user, class_name: "Public::User"
|
||||
|
||||
validates :token, presence: true, uniqueness: true
|
||||
validates :name, length: { maximum: 100 }
|
||||
|
||||
scope :not_revoked, -> { where(revoked_at: nil).or(where(revoked_at: Time.now..)) }
|
||||
scope :accessible, -> { not_revoked }
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue