generated from VLADIMIR/template_frontend
clear
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
import { useAuthStore } from "@/stores/auth";
|
||||
import { createEveningDetectiveServerClient, type EveningDetectiveServer } from "./generated/crabs/evening_detective_server";
|
||||
import { createHttpHandler } from "./generated/crabs/evening_detective_server/client";
|
||||
|
||||
export function getAuthClient() {
|
||||
const authStore = useAuthStore();
|
||||
return buildAuthClient(authStore.refreshTokenAction, authStore.getToken)
|
||||
}
|
||||
|
||||
export function buildAuthClient(
|
||||
function buildAuthClient(
|
||||
refreshTokens: () => Promise<boolean>,
|
||||
getToken: () => string | null,
|
||||
): EveningDetectiveServer {
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { buildAuthClient } from '@/api/auth_client';
|
||||
import { getAuthClient } from '@/api/auth_client';
|
||||
import router from '@/router';
|
||||
import { useAuthStore } from '@/stores/auth';
|
||||
import { ref } from 'vue';
|
||||
|
||||
const authStore = useAuthStore();
|
||||
|
||||
const client = buildAuthClient(authStore.refreshTokenAction, authStore.getToken)
|
||||
const client = getAuthClient()
|
||||
|
||||
const permissions = ref<string[]>([])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user