File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616 "check:license" : " deno run -A tools/check_license.ts" ,
1717 "check:docs" : " deno doc --lint mod.ts" ,
1818 "check" : " deno task check:license --check" ,
19- "test" : " DENO_KV_PATH =:memory: deno test --unstable-kv --allow-env --allow-read --allow-run --parallel --trace-leaks --coverage --doc" ,
19+ "test" : " DKV_PATH =:memory: deno test --unstable-kv --allow-env --allow-read --allow-run --parallel --trace-leaks --coverage --doc" ,
2020 "coverage" : " deno coverage coverage" ,
2121 "ok" : " deno fmt --check && deno lint && deno task check && deno task test" ,
2222 "cov:gen" : " deno task coverage --lcov --output=cov.lcov" ,
Original file line number Diff line number Diff line change 11// Copyright 2023-2024 the Deno authors. All rights reserved. MIT license.
2- const DENO_KV_PATH_KEY = "DENO_KV_PATH " ;
2+ const DKV_PATH_KEY = "DKV_PATH " ;
33let path = undefined ;
44if (
5- ( await Deno . permissions . query ( { name : "env" , variable : DENO_KV_PATH_KEY } ) )
5+ ( await Deno . permissions . query ( { name : "env" , variable : DKV_PATH_KEY } ) )
66 . state === "granted"
77) {
8- path = Deno . env . get ( DENO_KV_PATH_KEY ) ;
8+ path = Deno . env . get ( DKV_PATH_KEY ) ;
99}
1010const kv = await Deno . openKv ( path ) ;
1111
@@ -34,10 +34,7 @@ export async function getAndDeleteOAuthSession(
3434 throw new Deno . errors . NotFound ( "OAuth session not found" ) ;
3535 }
3636
37- const res = await kv . atomic ( )
38- . check ( oauthSessionRes )
39- . delete ( key )
40- . commit ( ) ;
37+ const res = await kv . atomic ( ) . check ( oauthSessionRes ) . delete ( key ) . commit ( ) ;
4138
4239 if ( ! res . ok ) throw new Error ( "Failed to delete OAuth session" ) ;
4340 return oauthSession ;
You can’t perform that action at this time.
0 commit comments