jwt oba nix geht

This commit is contained in:
dhain 2022-09-26 23:07:39 +02:00
parent 15ed4bd993
commit 1c1d758ab1
4 changed files with 45 additions and 32 deletions

View file

@ -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();