fix: scope user access token serialization
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
# Withhold the full-scope token from callers who authenticated with a
|
||||
# read-only token — otherwise GET /api/v1/profile would let a read-only
|
||||
# holder lift the full token and bypass the scope gate entirely.
|
||||
json.access_token resource.access_token&.token unless @access_token&.scope == 'read_only'
|
||||
json.read_only_access_token resource.read_only_access_token&.token
|
||||
if local_assigns[:include_access_tokens]
|
||||
# Withhold the full-scope token from callers who authenticated with a
|
||||
# read-only token — otherwise GET /api/v1/profile would let a read-only
|
||||
# holder lift the full token and bypass the scope gate entirely.
|
||||
json.access_token resource.access_token&.token unless @access_token&.scope == 'read_only'
|
||||
json.read_only_access_token resource.read_only_access_token&.token
|
||||
end
|
||||
json.account_id resource.active_account_user&.account_id
|
||||
json.available_name resource.available_name
|
||||
json.avatar_url resource.avatar_url
|
||||
|
||||
@@ -1 +1 @@
|
||||
json.partial! 'api/v1/models/user', formats: [:json], resource: @user
|
||||
json.partial! 'api/v1/models/user', formats: [:json], resource: @user, include_access_tokens: true
|
||||
|
||||
@@ -1 +1 @@
|
||||
json.partial! 'api/v1/models/user', formats: [:json], resource: @user
|
||||
json.partial! 'api/v1/models/user', formats: [:json], resource: @user, include_access_tokens: true
|
||||
|
||||
@@ -1 +1 @@
|
||||
json.partial! 'api/v1/models/user', formats: [:json], resource: @user
|
||||
json.partial! 'api/v1/models/user', formats: [:json], resource: @user, include_access_tokens: true
|
||||
|
||||
@@ -1 +1 @@
|
||||
json.partial! 'api/v1/models/user', formats: [:json], resource: @user
|
||||
json.partial! 'api/v1/models/user', formats: [:json], resource: @user, include_access_tokens: true
|
||||
|
||||
@@ -1 +1 @@
|
||||
json.partial! 'api/v1/models/user', formats: [:json], resource: @user
|
||||
json.partial! 'api/v1/models/user', formats: [:json], resource: @user, include_access_tokens: true
|
||||
|
||||
@@ -1 +1 @@
|
||||
json.partial! 'api/v1/models/user', formats: [:json], resource: @user
|
||||
json.partial! 'api/v1/models/user', formats: [:json], resource: @user, include_access_tokens: true
|
||||
|
||||
@@ -1 +1 @@
|
||||
json.partial! 'api/v1/models/user', formats: [:json], resource: @user
|
||||
json.partial! 'api/v1/models/user', formats: [:json], resource: @user, include_access_tokens: true
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
json.data do
|
||||
json.partial! 'api/v1/models/user', formats: [:json], resource: resource
|
||||
json.partial! 'api/v1/models/user', formats: [:json], resource: resource, include_access_tokens: true
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user