Compare commits
3 commits
c0df384d7b
...
c1021b1192
Author | SHA1 | Date | |
---|---|---|---|
c1021b1192 | |||
aa335b086a | |||
87f4ecc9dc |
4 changed files with 17 additions and 18 deletions
|
@ -1,5 +0,0 @@
|
||||||
export default defineAppConfig({
|
|
||||||
title: "Gorb",
|
|
||||||
buildTimeString: new Date().toISOString(),
|
|
||||||
gitHash: process.env.GIT_SHORT_REV || "N/A"
|
|
||||||
})
|
|
|
@ -37,13 +37,19 @@ export const useAuth = () => {
|
||||||
//await fetchUser();
|
//await fetchUser();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function logout(password: string) {
|
async function logout() {
|
||||||
console.log("password:", password);
|
|
||||||
console.log("access:", accessToken.value);
|
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",
|
method: "POST",
|
||||||
body:
|
body:
|
||||||
{
|
{
|
||||||
|
@ -54,10 +60,6 @@ export const useAuth = () => {
|
||||||
clearAuth();
|
clearAuth();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function revoke() {
|
|
||||||
clearAuth();
|
|
||||||
}
|
|
||||||
|
|
||||||
async function refresh() {
|
async function refresh() {
|
||||||
console.log("refreshing");
|
console.log("refreshing");
|
||||||
const res = await fetchWithApi("/auth/refresh", {
|
const res = await fetchWithApi("/auth/refresh", {
|
||||||
|
|
|
@ -27,7 +27,9 @@ export default defineNuxtConfig({
|
||||||
runtimeConfig: {
|
runtimeConfig: {
|
||||||
public: {
|
public: {
|
||||||
apiVersion: 1,
|
apiVersion: 1,
|
||||||
messageGroupingMaxDifference: 300000
|
messageGroupingMaxDifference: 300000,
|
||||||
|
buildTimeString: new Date().toISOString(),
|
||||||
|
gitHash: process.env.GIT_SHORT_REV || "N/A",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/* nitro: {
|
/* nitro: {
|
||||||
|
|
|
@ -24,9 +24,9 @@
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p style="font-size: .8em; color: var(--secondary-text-color)">
|
<p style="font-size: .8em; color: var(--secondary-text-color)">
|
||||||
Version Hash: {{ appConfig.gitHash }}
|
Version Hash: {{ appConfig.public.gitHash }}
|
||||||
<br>
|
<br>
|
||||||
Build Time: {{ appConfig.buildTimeString }}
|
Build Time: {{ appConfig.public.buildTimeString }}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -44,7 +44,7 @@ import Button from '~/components/Button.vue';
|
||||||
|
|
||||||
const { logout } = useAuth()
|
const { logout } = useAuth()
|
||||||
|
|
||||||
const appConfig = useAppConfig()
|
const appConfig = useRuntimeConfig()
|
||||||
|
|
||||||
interface Page {
|
interface Page {
|
||||||
displayName: string;
|
displayName: string;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue