feat: update frontend to expect server to set access token
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful

This commit is contained in:
SauceyRed 2025-07-15 17:49:16 +02:00
parent a146eb001a
commit 8101c83825
Signed by: sauceyred
GPG key ID: 2BF92EB6D8A5CCA7

View file

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