jwt oba nix geht
This commit is contained in:
parent
15ed4bd993
commit
1c1d758ab1
4 changed files with 45 additions and 32 deletions
|
|
@ -1,3 +1,5 @@
|
|||
import {parseCookies} from "nookies";
|
||||
|
||||
/**
|
||||
* Capitalises first letter of string.
|
||||
* @param str
|
||||
|
|
@ -18,4 +20,14 @@ export async function bearerFetch(endpoint: string, jwt: string, baseUrl: string
|
|||
Authorization: `Bearer ${jwt}`
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const getJwtCookie = () => {
|
||||
return parseCookies("/").jwt;
|
||||
};
|
||||
|
||||
/**
|
||||
* JWT Cookie
|
||||
*/
|
||||
export const jwt: string = getJwtCookie();
|
||||
Loading…
Add table
Add a link
Reference in a new issue