From 26f8216ec85fd8386cb61efa53ace43a541f5304 Mon Sep 17 00:00:00 2001 From: Asher Date: Thu, 6 Feb 2020 14:00:38 -0600 Subject: [PATCH] Un-nest a switch --- src/node/api/server.ts | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/node/api/server.ts b/src/node/api/server.ts index ec1ac452..339a8364 100644 --- a/src/node/api/server.ts +++ b/src/node/api/server.ts @@ -39,16 +39,15 @@ export class ApiHttpProvider extends HttpProvider { return this.login(request) } break - default: - if (!this.authenticated(request)) { - return { code: HttpCode.Unauthorized } - } - switch (route.base) { - case ApiEndpoint.applications: - return this.applications() - case ApiEndpoint.files: - return this.files() - } + } + if (!this.authenticated(request)) { + return { code: HttpCode.Unauthorized } + } + switch (route.base) { + case ApiEndpoint.applications: + return this.applications() + case ApiEndpoint.files: + return this.files() } return undefined }