Skip to content

Commit 31c4830

Browse files
committed
Fix MfaStatus policy subject
1 parent 91b2c8e commit 31c4830

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

app/graphql/types/mfa_status_type.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ class MfaStatusType < Types::BaseObject
55
description 'Represents the MFA status of a user'
66

77
authorize :read_mfa_status
8+
declarative_policy_subject { |obj| obj[:user] }
89

910
field :enabled, Boolean, null: false,
1011
description: 'Indicates whether MFA is enabled for the user.'

app/graphql/types/user_type.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def mfa_status
7575
enabled: object.mfa_enabled?,
7676
totp_enabled: object.totp_secret.present?,
7777
backup_codes_count: object.backup_codes.size,
78+
user: object,
7879
}
7980
end
8081
end

0 commit comments

Comments
 (0)