Skip to content

Commit 6981836

Browse files
committed
Enhance invitation token authorization by ensuring policy scope is resolved correctly and marking scope authorization
1 parent f0aab73 commit 6981836

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/controllers/concerns/better_together/invitation_token_authorization.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ def policy_scope(scope, policy_scope_class: nil, invitation_token: nil)
4545
token = invitation_token || current_invitation_token
4646

4747
# Create policy scope instance with invitation token
48-
policy_scope_class.new(current_user, scope, invitation_token: token).resolve
48+
scope = policy_scope_class.new(current_user, scope, invitation_token: token).resolve
49+
50+
@_pundit_policy_scoped = true
51+
52+
scope
4953
end
5054

5155
# Set the current invitation token for use in authorization

0 commit comments

Comments
 (0)