Refactor auth middleware to accept multiple auth modes

This commit is contained in:
Tuan Dang
2023-01-01 09:24:20 +07:00
parent 7e4bf7f44b
commit b8a64714d2
8 changed files with 138 additions and 67 deletions
+10
View File
@@ -113,4 +113,14 @@ export const AccountNotFoundError = (error?: Partial<RequestErrorContext>) => ne
stack: error?.stack
})
//* ----->[SERVICE TOKEN DATA ERRORS]<-----
export const ServiceTokenDataNotFoundError = (error?: Partial<RequestErrorContext>) => new RequestError({
logLevel: error?.logLevel ?? LogLevel.ERROR,
statusCode: error?.statusCode ?? 404,
type: error?.type ?? 'service_token_data_not_found_error',
message: error?.message ?? 'The requested service token data was not found',
context: error?.context,
stack: error?.stack
})
//* ----->[MISC ERRORS]<-----