Compare commits

...

3 commits

Author SHA1 Message Date
c1021b1192
fix: fix build time and version hash being evaluated at runtime
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
ci/woodpecker/pr/build-and-publish Pipeline was successful
ci/woodpecker/pull_request_closed/build-and-publish Pipeline was successful
2025-07-05 15:24:09 +02:00
aa335b086a
feat: use logout endpoint for logout and move old logic to revoke in auth
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
2025-07-05 02:38:23 +02:00
87f4ecc9dc Merge pull request 'feat: add links, build time, and git hash to settings menu' (#13) from settings-metadata into main
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
Reviewed-on: #13
Reviewed-by: SauceyRed <saucey@saucey.red>
2025-07-04 23:40:23 +00:00
4 changed files with 17 additions and 18 deletions

View file

@ -1,5 +0,0 @@
export default defineAppConfig({
title: "Gorb",
buildTimeString: new Date().toISOString(),
gitHash: process.env.GIT_SHORT_REV || "N/A"
})

View file

@ -37,13 +37,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:
{
@ -54,10 +60,6 @@ export const useAuth = () => {
clearAuth();
}
async function revoke() {
clearAuth();
}
async function refresh() {
console.log("refreshing");
const res = await fetchWithApi("/auth/refresh", {

View file

@ -27,7 +27,9 @@ export default defineNuxtConfig({
runtimeConfig: {
public: {
apiVersion: 1,
messageGroupingMaxDifference: 300000
messageGroupingMaxDifference: 300000,
buildTimeString: new Date().toISOString(),
gitHash: process.env.GIT_SHORT_REV || "N/A",
}
},
/* nitro: {

View file

@ -24,9 +24,9 @@
</p>
<p style="font-size: .8em; color: var(--secondary-text-color)">
Version Hash: {{ appConfig.gitHash }}
Version Hash: {{ appConfig.public.gitHash }}
<br>
Build Time: {{ appConfig.buildTimeString }}
Build Time: {{ appConfig.public.buildTimeString }}
</p>
</ul>
@ -44,7 +44,7 @@ import Button from '~/components/Button.vue';
const { logout } = useAuth()
const appConfig = useAppConfig()
const appConfig = useRuntimeConfig()
interface Page {
displayName: string;