Compare commits
No commits in common. "c1021b11922a423bb233fef5e18ed38a8e5d100f" and "c0df384d7bf3d2a0359549f15d8c8d25990fbc33" have entirely different histories.
c1021b1192
...
c0df384d7b
4 changed files with 17 additions and 16 deletions
5
app.config.ts
Normal file
5
app.config.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
export default defineAppConfig({
|
||||
title: "Gorb",
|
||||
buildTimeString: new Date().toISOString(),
|
||||
gitHash: process.env.GIT_SHORT_REV || "N/A"
|
||||
})
|
|
@ -37,19 +37,13 @@ export const useAuth = () => {
|
|||
//await fetchUser();
|
||||
}
|
||||
|
||||
async function logout() {
|
||||
async function logout(password: string) {
|
||||
console.log("password:", password);
|
||||
console.log("access:", accessToken.value);
|
||||
|
||||
await fetchWithApi("/auth/logout", { method: "GET", credentials: "include" });
|
||||
clearAuth();
|
||||
|
||||
return await navigateTo("/login");
|
||||
}
|
||||
|
||||
async function revoke(password: string) {
|
||||
const hashedPass = await hashPassword(password);
|
||||
console.log("hashed");
|
||||
|
||||
await fetchWithApi("/auth/revoke", {
|
||||
const res = await fetchWithApi("/auth/revoke", {
|
||||
method: "POST",
|
||||
body:
|
||||
{
|
||||
|
@ -60,6 +54,10 @@ export const useAuth = () => {
|
|||
clearAuth();
|
||||
}
|
||||
|
||||
async function revoke() {
|
||||
clearAuth();
|
||||
}
|
||||
|
||||
async function refresh() {
|
||||
console.log("refreshing");
|
||||
const res = await fetchWithApi("/auth/refresh", {
|
||||
|
|
|
@ -27,9 +27,7 @@ export default defineNuxtConfig({
|
|||
runtimeConfig: {
|
||||
public: {
|
||||
apiVersion: 1,
|
||||
messageGroupingMaxDifference: 300000,
|
||||
buildTimeString: new Date().toISOString(),
|
||||
gitHash: process.env.GIT_SHORT_REV || "N/A",
|
||||
messageGroupingMaxDifference: 300000
|
||||
}
|
||||
},
|
||||
/* nitro: {
|
||||
|
|
|
@ -24,9 +24,9 @@
|
|||
</p>
|
||||
|
||||
<p style="font-size: .8em; color: var(--secondary-text-color)">
|
||||
Version Hash: {{ appConfig.public.gitHash }}
|
||||
Version Hash: {{ appConfig.gitHash }}
|
||||
<br>
|
||||
Build Time: {{ appConfig.public.buildTimeString }}
|
||||
Build Time: {{ appConfig.buildTimeString }}
|
||||
</p>
|
||||
|
||||
</ul>
|
||||
|
@ -44,7 +44,7 @@ import Button from '~/components/Button.vue';
|
|||
|
||||
const { logout } = useAuth()
|
||||
|
||||
const appConfig = useRuntimeConfig()
|
||||
const appConfig = useAppConfig()
|
||||
|
||||
interface Page {
|
||||
displayName: string;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue