File tree 2 files changed +9
-6
lines changed
2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -63,9 +63,10 @@ export const ensureAuthenticated = async (
63
63
*/
64
64
export const authenticated = async ( req : express . Request ) : Promise < boolean > => {
65
65
switch ( req . args . auth ) {
66
- case AuthType . None :
66
+ case AuthType . None : {
67
67
return true
68
- case AuthType . Password :
68
+ }
69
+ case AuthType . Password : {
69
70
// The password is stored in the cookie after being hashed.
70
71
const hashedPasswordFromArgs = req . args [ "hashed-password" ]
71
72
const passwordMethod = getPasswordMethod ( hashedPasswordFromArgs )
@@ -77,8 +78,10 @@ export const authenticated = async (req: express.Request): Promise<boolean> => {
77
78
}
78
79
79
80
return await isCookieValid ( isCookieValidArgs )
80
- default :
81
+ }
82
+ default : {
81
83
throw new Error ( `Unsupported auth type ${ req . args . auth } ` )
84
+ }
82
85
}
83
86
}
84
87
Original file line number Diff line number Diff line change
1
+ import { logger } from "@coder/logger"
2
+ import * as argon2 from "argon2"
1
3
import * as cp from "child_process"
2
4
import * as crypto from "crypto"
3
- import * as argon2 from "argon2"
4
5
import envPaths from "env-paths"
5
6
import { promises as fs } from "fs"
6
7
import * as net from "net"
7
8
import * as os from "os"
8
9
import * as path from "path"
10
+ import safeCompare from "safe-compare"
9
11
import * as util from "util"
10
12
import xdgBasedir from "xdg-basedir"
11
- import safeCompare from "safe-compare"
12
- import { logger } from "@coder/logger"
13
13
14
14
export interface Paths {
15
15
data : string
You can’t perform that action at this time.
0 commit comments