This commit is contained in:
Kristaps Fabians Geikins
2024-09-25 15:55:49 +03:00
parent af92ad0e78
commit 7a5bf6cc79
3 changed files with 8 additions and 8 deletions
@@ -18,7 +18,10 @@ export type GetUserServerRole = (params: {
userId: string
}) => Promise<Optional<ServerRoles>>
export type ValidateScopes = (scopes: Optional<string[]>, scope: string) => void
export type ValidateScopes = (
scopes: Optional<string[]>,
scope: string
) => Promise<void>
export type AuthorizeResolver = (
userId: MaybeNullOrUndefined<string>,
@@ -18,7 +18,7 @@ import { Roles } from '@speckle/shared'
/**
* Validates the scope against a list of scopes of the current session.
*/
export const validateScopesFactory = (): ValidateScopes => (scopes, scope) => {
export const validateScopesFactory = (): ValidateScopes => async (scopes, scope) => {
const errMsg = `Your auth token does not have the required scope${
scope?.length ? ': ' + scope + '.' : '.'
}`