Merge branch 'main' into email-verification
This commit is contained in:
commit
822b16ae07
23 changed files with 477 additions and 66 deletions
|
@ -38,13 +38,19 @@ export const useAuth = () => {
|
|||
//await fetchUser();
|
||||
}
|
||||
|
||||
async function logout(password: string) {
|
||||
console.log("password:", password);
|
||||
async function logout() {
|
||||
console.log("access:", accessToken.value);
|
||||
const hashedPass = await hashPassword(password);
|
||||
console.log("hashed");
|
||||
|
||||
const res = await fetchWithApi("/auth/revoke", {
|
||||
await fetchWithApi("/auth/logout", { method: "GET", credentials: "include" });
|
||||
clearAuth();
|
||||
|
||||
return await navigateTo("/login");
|
||||
}
|
||||
|
||||
async function revoke(password: string) {
|
||||
const hashedPass = await hashPassword(password);
|
||||
|
||||
await fetchWithApi("/auth/revoke", {
|
||||
method: "POST",
|
||||
body:
|
||||
{
|
||||
|
@ -55,10 +61,6 @@ export const useAuth = () => {
|
|||
clearAuth();
|
||||
}
|
||||
|
||||
async function revoke() {
|
||||
clearAuth();
|
||||
}
|
||||
|
||||
async function refresh() {
|
||||
console.log("refreshing");
|
||||
const res = await fetchWithApi("/auth/refresh", {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue