File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env -S deno run --import-map vendor/import_map.json --allow-net --allow-read=. --allow-write=refresh_tokens.json --allow-run=chroot/jail --check
2
2
3
- import { Deferred , deferred } from "https://deno.land/std@0.136.0/async/mod.ts" ;
3
+ import { deferred } from "https://deno.land/std@0.136.0/async/mod.ts" ;
4
4
import { Status , serve } from "https://deno.land/std@0.136.0/http/mod.ts" ;
5
5
import { BufReader } from "https://deno.land/std@0.136.0/io/mod.ts" ;
6
6
import { basename } from "https://deno.land/std@0.136.0/path/mod.ts" ;
@@ -19,7 +19,7 @@ const tokenToPort: {[_: string]: number} = {};
19
19
async function handler ( request : Request ) : Promise < Response > {
20
20
const url = new URL ( request . url ) ;
21
21
22
- let token = request . headers . get ( "Cookie" ) ?. split ( ", " ) . find ( function ( each ) {
22
+ const token = request . headers . get ( "Cookie" ) ?. split ( ", " ) . find ( function ( each ) {
23
23
return each . startsWith ( "vscode-tkn=" ) ;
24
24
} ) ?. split ( "=" ) [ 1 ] ?? url . searchParams . get ( "tkn" ) ;
25
25
if ( token && Object . hasOwn ( tokenToPort , token ) )
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { mutex } from "./mutex.ts";
4
4
export const BACKING_FILE = "refresh_tokens.json" ;
5
5
6
6
let tokens : { [ _ : string ] : string } | null = null ;
7
- let lock = mutex ( ) ;
7
+ const lock = mutex ( ) ;
8
8
9
9
export async function getToken ( username : string ) : Promise < string | null > {
10
10
if ( ! tokens )
You can’t perform that action at this time.
0 commit comments