Pierre Tellier 66be0baca6
All checks were successful
Format / formatting (push) Successful in 6s
Build / build (push) Successful in 5m20s
CI / build (push) Successful in 11s
feat: created a better account creation flow
2025-04-09 17:39:43 +02:00

146 lines
3.9 KiB
Vue

<script lang="ts" setup>
import { store } from "../main.ts";
import { callApi } from "@/services/api.ts";
import { ref } from "vue";
const CustomRequest = ref("");
const USERID = ref("");
</script>
<template>
<h1>Test page</h1>
<table class="test" style="width: 100%">
<tbody>
<tr>
<td>Is Currently Authenticated ?</td>
<td>{{ store.authenticated }}</td>
<td>
<button @click="store.login">Login</button>
</td>
<td>
<button @click="store.logout">Logout</button>
</td>
<td>
<button @click="store.signup">Signup</button>
</td>
</tr>
<tr>
<td>current token</td>
<td>{{ store.user.token }}</td>
<td>
<button @click="store.refreshUserToken">Refresh</button>
</td>
</tr>
<tr>
<td>Current refresh token</td>
<td>{{ store.user.refreshToken }}</td>
</tr>
<tr>
<td>
<input v-model="CustomRequest" placeholder="edit me" />
</td>
<td>
<button @click="callApi(CustomRequest)">call</button>
</td>
</tr>
<tr>
<td>Create an account</td>
<td>
<button @click="callApi('unauth/create_account')">
call
</button>
</td>
<td>res</td>
<td id="4"></td>
</tr>
<tr>
<td>Get Pending Accounts</td>
<td>
<button @click="callApi('admin/get_pending_accounts')">
call
</button>
</td>
<td>res</td>
<td id="6"></td>
</tr>
<tr>
<td>admin/validate_user_account/{id}</td>
<td>
<button
@click="
callApi('admin/validate_user_account/' + USERID)
"
>
call
</button>
</td>
<td>
<input v-model="USERID" placeholder="user ID" />
</td>
<td id="5"></td>
</tr>
<tr>
<td>admin/setadmin/{uid}</td>
<td>
<button @click="callApi('admin/setadmin/' + USERID)">
call
</button>
</td>
<td>
<input v-model="USERID" placeholder="user ID" />
</td>
</tr>
<tr>
<td>Unauth API call</td>
<td>
<button @click="callApi('unauth/dev')">call</button>
</td>
<td>res</td>
<td id="8"></td>
</tr>
<tr>
<td>Unauth API call</td>
<td>
<button @click="callApi('unauth/dev')">call</button>
</td>
<td>res</td>
<td id="9"></td>
</tr>
<tr>
<td>Unauth API call</td>
<td>
<button @click="callApi('unauth/dev')">call</button>
</td>
<td>res</td>
<td id="10"></td>
</tr>
</tbody>
</table>
</template>
<style scoped>
table {
width: 100px;
table-layout: fixed;
}
tr {
width: 100%;
height: 100%;
}
td {
border: solid 1px black;
width: 20%;
height: 100%;
overflow: hidden;
}
</style>