1 |
|
2 |
|
3 |
|
4 | const obj: {
|
5 | oauth_state?: string;
|
6 | ouath_pkce_key?: string;
|
7 | } = {};
|
8 |
|
9 | export const setState = (state: string) => {
|
10 | obj.oauth_state = state;
|
11 | };
|
12 |
|
13 | export const getState = () => {
|
14 | const oauth_state = obj.oauth_state;
|
15 | obj.oauth_state = undefined;
|
16 | return oauth_state;
|
17 | };
|
18 |
|
19 | export const setPKCE = (private_key: string) => {
|
20 | obj.ouath_pkce_key = private_key;
|
21 | };
|
22 |
|
23 | export const getPKCE = () => {
|
24 | const ouath_pkce_key = obj.ouath_pkce_key;
|
25 | obj.ouath_pkce_key = undefined;
|
26 | return ouath_pkce_key;
|
27 | };
|
28 |
|
29 | export const clearAll = () => {
|
30 | obj.ouath_pkce_key = undefined;
|
31 | obj.oauth_state = undefined;
|
32 | };
|