refactor(server scopes): use constants for profile email scope

This commit is contained in:
Gergő Jedlicska
2023-07-26 13:32:08 +02:00
parent 61c4869091
commit c22e0dfe23
6 changed files with 13 additions and 13 deletions
@@ -86,7 +86,7 @@ describe('Activity @activity', () => {
Scopes.Tokens.Write,
Scopes.Tokens.Read,
Scopes.Profile.Read,
'profile:email'
Scopes.Profile.Email
]
// create users
@@ -97,7 +97,7 @@ module.exports = {
// NOTE: we're redacting the field (returning null) rather than throwing a full error which would invalidate the request.
if (context.userId === parent.id) {
try {
await validateScopes(context.scopes, 'profile:email')
await validateScopes(context.scopes, Scopes.Profile.Email)
return parent.email
} catch (err) {
return null
@@ -52,7 +52,7 @@ describe('GraphQL API Core @core-api', () => {
Scopes.Tokens.Write,
Scopes.Tokens.Read,
Scopes.Profile.Read,
'profile:email'
Scopes.Profile.Email
]
)}`
userB.id = await createUser(userB)
@@ -67,7 +67,7 @@ describe('GraphQL API Core @core-api', () => {
Scopes.Tokens.Write,
Scopes.Tokens.Read,
Scopes.Profile.Read,
'profile:email'
Scopes.Profile.Email
]
)}`
userC.id = await createUser(userC)
@@ -82,7 +82,7 @@ describe('GraphQL API Core @core-api', () => {
Scopes.Tokens.Write,
Scopes.Tokens.Read,
Scopes.Profile.Read,
'profile:email'
Scopes.Profile.Email
]
)}`
@@ -250,7 +250,7 @@ describe('GraphQL API Core @core-api', () => {
Scopes.Tokens.Write,
Scopes.Tokens.Read,
Scopes.Profile.Read,
'profile:email'
Scopes.Profile.Email
]
)}`
@@ -278,7 +278,7 @@ describe('GraphQL API Core @core-api', () => {
Scopes.Tokens.Write,
Scopes.Tokens.Read,
Scopes.Profile.Read,
'profile:email',
Scopes.Profile.Email,
'profile:delete'
]
)}`
@@ -1700,7 +1700,7 @@ describe('GraphQL API Core @core-api', () => {
Scopes.Tokens.Write,
Scopes.Tokens.Read,
Scopes.Profile.Read,
'profile:email',
Scopes.Profile.Email,
'apps:read',
'apps:write',
'users:invite'
@@ -107,7 +107,7 @@ describe('GraphQL API Subscriptions @gql-subscriptions', () => {
Scopes.Tokens.Write,
Scopes.Tokens.Read,
Scopes.Profile.Read,
'profile:email'
Scopes.Profile.Email
])
userA.token = `Bearer ${token}`
@@ -123,7 +123,7 @@ describe('GraphQL API Subscriptions @gql-subscriptions', () => {
Scopes.Tokens.Write,
Scopes.Tokens.Read,
Scopes.Profile.Read,
'profile:email'
Scopes.Profile.Email
]
)}`
@@ -48,7 +48,7 @@ describe('Upload/Download Routes @api-rest', () => {
Scopes.Tokens.Write,
Scopes.Tokens.Read,
Scopes.Profile.Read,
'profile:email'
Scopes.Profile.Email
]
)}`
@@ -64,7 +64,7 @@ describe('Upload/Download Routes @api-rest', () => {
Scopes.Tokens.Write,
Scopes.Tokens.Read,
Scopes.Profile.Read,
'profile:email'
Scopes.Profile.Email
]
)}`
+1 -1
View File
@@ -38,7 +38,7 @@ const main = async () => {
Scopes.Tokens.Write,
Scopes.Tokens.Read,
Scopes.Profile.Read,
'profile:email'
Scopes.Profile.Email
]
)}`