Skip to content

Commit 20786db

Browse files
committed
fixup
1 parent ba8c796 commit 20786db

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/node/http.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ export const ensureAuthenticated = async (
6363
*/
6464
export const authenticated = async (req: express.Request): Promise<boolean> => {
6565
switch (req.args.auth) {
66-
case AuthType.None:
66+
case AuthType.None: {
6767
return true
68-
case AuthType.Password:
68+
}
69+
case AuthType.Password: {
6970
// The password is stored in the cookie after being hashed.
7071
const hashedPasswordFromArgs = req.args["hashed-password"]
7172
const passwordMethod = getPasswordMethod(hashedPasswordFromArgs)
@@ -77,8 +78,10 @@ export const authenticated = async (req: express.Request): Promise<boolean> => {
7778
}
7879

7980
return await isCookieValid(isCookieValidArgs)
80-
default:
81+
}
82+
default: {
8183
throw new Error(`Unsupported auth type ${req.args.auth}`)
84+
}
8285
}
8386
}
8487

src/node/util.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1+
import { logger } from "@coder/logger"
2+
import * as argon2 from "argon2"
13
import * as cp from "child_process"
24
import * as crypto from "crypto"
3-
import * as argon2 from "argon2"
45
import envPaths from "env-paths"
56
import { promises as fs } from "fs"
67
import * as net from "net"
78
import * as os from "os"
89
import * as path from "path"
10+
import safeCompare from "safe-compare"
911
import * as util from "util"
1012
import xdgBasedir from "xdg-basedir"
11-
import safeCompare from "safe-compare"
12-
import { logger } from "@coder/logger"
1313

1414
export interface Paths {
1515
data: string

0 commit comments

Comments
 (0)