Increase the thing
This commit is contained in:
@@ -26,6 +26,24 @@ class OidcUserConsent < ApplicationRecord
|
||||
(requested - granted).empty?
|
||||
end
|
||||
|
||||
# Get a human-readable list of scopes
|
||||
def formatted_scopes
|
||||
scopes.map do |scope|
|
||||
case scope
|
||||
when 'openid'
|
||||
'Basic authentication'
|
||||
when 'profile'
|
||||
'Profile information'
|
||||
when 'email'
|
||||
'Email address'
|
||||
when 'groups'
|
||||
'Group membership'
|
||||
else
|
||||
scope.humanize
|
||||
end
|
||||
end.join(', ')
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_granted_at
|
||||
|
||||
@@ -80,6 +80,15 @@ class User < ApplicationRecord
|
||||
.find { |consent| consent.covers_scopes?(requested_scopes) }
|
||||
end
|
||||
|
||||
def revoke_consent!(application)
|
||||
consent = oidc_user_consents.find_by(application: application)
|
||||
consent&.destroy
|
||||
end
|
||||
|
||||
def revoke_all_consents!
|
||||
oidc_user_consents.destroy_all
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def generate_backup_codes
|
||||
|
||||
Reference in New Issue
Block a user