mirror of
https://github.com/docusealco/docuseal
synced 2026-11-06 23:12:33 -05:00
add access tokens
This commit is contained in:
1 parent
e75e7b18b4
commit
6d78d5430c
7 files changed
+76
-8
No files matched your search
@@ -45,6 +45,7 @@ class User < ApplicationRecord
|
||||
EMAIL_REGEXP = /[^@,\s]+@[^@,\s]+/
|
||||
|
||||
belongs_to :account
|
||||
has_one :access_token, dependent: :destroy
|
||||
|
||||
devise :database_authenticatable, :recoverable, :rememberable, :validatable, :trackable
|
||||
devise :registerable, :omniauthable, omniauth_providers: [:google_oauth2] if Docuseal.multitenant?
|
||||
@@ -54,6 +55,10 @@ class User < ApplicationRecord
|
||||
|
||||
scope :active, -> { where(deleted_at: nil) }
|
||||
|
||||
def access_token
|
||||
super || build_access_token.tap(&:save!)
|
||||
end
|
||||
|
||||
def active_for_authentication?
|
||||
!deleted_at?
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user