feat: update frontend to expect server to set access token
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
This commit is contained in:
parent
a146eb001a
commit
8101c83825
1 changed files with 3 additions and 6 deletions
|
@ -17,9 +17,8 @@ export const useAuth = () => {
|
||||||
{
|
{
|
||||||
email, identifier: username, password: hashedPass, device_name: "Linux Laptop"
|
email, identifier: username, password: hashedPass, device_name: "Linux Laptop"
|
||||||
}
|
}
|
||||||
}) as { access_token: string, refresh_token: string };
|
});
|
||||||
//authStore.setAccessToken(accessToken);
|
//authStore.setAccessToken(accessToken);
|
||||||
accessToken.value = res.access_token;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function login(username: string, password: string, device_name: string) {
|
async function login(username: string, password: string, device_name: string) {
|
||||||
|
@ -31,9 +30,8 @@ export const useAuth = () => {
|
||||||
{
|
{
|
||||||
username, password: hashedPass, device_name: "Linux Laptop"
|
username, password: hashedPass, device_name: "Linux Laptop"
|
||||||
}
|
}
|
||||||
}) as { access_token: string, refresh_token: string };
|
});
|
||||||
console.log("hi");
|
console.log("hi");
|
||||||
accessToken.value = res.access_token;
|
|
||||||
console.log("access token:", accessToken.value);
|
console.log("access token:", accessToken.value);
|
||||||
//await fetchUser();
|
//await fetchUser();
|
||||||
}
|
}
|
||||||
|
@ -67,8 +65,7 @@ export const useAuth = () => {
|
||||||
method: "POST"
|
method: "POST"
|
||||||
}) as any;
|
}) as any;
|
||||||
console.log("finished refreshing:", res);
|
console.log("finished refreshing:", res);
|
||||||
if (res && res.access_token) {
|
if (res) {
|
||||||
accessToken.value = res.access_token;
|
|
||||||
console.log("set new access token");
|
console.log("set new access token");
|
||||||
} else {
|
} else {
|
||||||
console.log("refresh didn't return access token");
|
console.log("refresh didn't return access token");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue