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();
|
||||
}
|
||||
|
||||
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", {
|
||||
|
|
|
@ -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: {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue