@@ -6,7 +6,7 @@ import * as semver from "semver"
6
6
import * as pluginapi from "../../typings/pluginapi"
7
7
import { HttpCode , HttpError } from "../common/http"
8
8
import { version } from "./constants"
9
- import { ensureAuthenticated , replaceTemplates } from "./http"
9
+ import { authenticated , ensureAuthenticated , replaceTemplates } from "./http"
10
10
import { proxy } from "./proxy"
11
11
import * as util from "./util"
12
12
import { Router as WsRouter , WebsocketRouter , wss } from "./wsRouter"
@@ -28,11 +28,13 @@ require("module")._load = function (request: string, parent: object, isMain: boo
28
28
* The module you get when importing "code-server".
29
29
*/
30
30
export const codeServer = {
31
- express,
32
- field,
33
31
HttpCode,
34
32
HttpError,
35
33
Level,
34
+ authenticated,
35
+ ensureAuthenticated,
36
+ express,
37
+ field,
36
38
proxy,
37
39
replaceTemplates,
38
40
WsRouter,
@@ -122,10 +124,10 @@ export class PluginAPI {
122
124
public mount ( r : express . Router , wr : express . Router ) : void {
123
125
for ( const [ , p ] of this . plugins ) {
124
126
if ( p . router ) {
125
- r . use ( `${ p . routerPath } ` , ensureAuthenticated , p . router ( ) )
127
+ r . use ( `${ p . routerPath } ` , p . router ( ) )
126
128
}
127
129
if ( p . wsRouter ) {
128
- wr . use ( `${ p . routerPath } ` , ensureAuthenticated , ( p . wsRouter ( ) as WebsocketRouter ) . router )
130
+ wr . use ( `${ p . routerPath } ` , ( p . wsRouter ( ) as WebsocketRouter ) . router )
129
131
}
130
132
}
131
133
}
0 commit comments