File tree Expand file tree Collapse file tree 3 files changed +20
-2
lines changed
packages/npm/@amazeelabs/decap-cms-backend-token-auth Expand file tree Collapse file tree 3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 46
46
"devDependencies" : {
47
47
"@amazeelabs/eslint-config" : " 1.4.43" ,
48
48
"@octokit/types" : " 13.5.0" ,
49
+ "@types/js-cookie" : " 3.0.6" ,
49
50
"@types/node" : " 18.19.33" ,
50
51
"@types/react" : " 18.3.1" ,
51
52
"@types/semaphore" : " 1.1.4" ,
53
+ "js-cookie" : " 3.0.5" ,
52
54
"typescript" : " 5.4.5" ,
53
55
"vitest" : " 1.6.0"
54
56
},
Original file line number Diff line number Diff line change 1
1
import { TokenAuthClient } from '@amazeelabs/token-auth-middleware' ;
2
2
import { GitHubBackend } from 'decap-cms-backend-github' ;
3
3
import { Implementation } from 'decap-cms-lib-util' ;
4
+ import Cookies from 'js-cookie' ;
4
5
5
6
import { AuthComponent } from './ui.js' ;
6
7
@@ -55,7 +56,7 @@ export class TokenAuthBackend implements Implementation {
55
56
// Authenticate against the delegate backend.
56
57
await this . delegate . authenticate ( status ) ;
57
58
// Let frontend know that user is logged in.
58
- sessionStorage . setItem ( 'decap-cms-logged-in' , '1' ) ;
59
+ Cookies . set ( 'decap-cms-logged-in' , '1' ) ;
59
60
// Return status information.
60
61
return {
61
62
...status ,
@@ -81,7 +82,7 @@ export class TokenAuthBackend implements Implementation {
81
82
async logout ( ) {
82
83
await this . client . logout ( ) ;
83
84
await this . delegate . logout ( ) ;
84
- sessionStorage . removeItem ( 'decap-cms-logged-in' ) ;
85
+ Cookies . remove ( 'decap-cms-logged-in' ) ;
85
86
}
86
87
87
88
/**
You can’t perform that action at this time.
0 commit comments