Feature/Auth: last one was authentication, this one is authorization #4

Merged
homeburger merged 33 commits from feature/auth into main 2026-04-23 00:18:39 -05:00
4 changed files with 8 additions and 8 deletions
Showing only changes of commit 30214bd212 - Show all commits

View File

@@ -6,16 +6,16 @@ export interface UserDto {
createdAt: string;
email: string;
id: string;
username: string;
userName: string;
}
export interface RegisterDto {
username: string;
userName: string;
email: string;
password: string;
}
export interface LoginDto {
username: string;
userName: string;
password: string;
}

View File

@@ -10,7 +10,7 @@ import * as authApi from "../api/AuthApi";
const router = useRouter();
const user = reactive<LoginDto>({ // the template ensures type consistency
username: "",
userName: "",
password: "",
});
@@ -40,7 +40,7 @@ async function login(): Promise<void> {
<h2>Login</h2>
<form @submit.prevent="login">
<input v-model="user.username" placeholder="username" />
<input v-model="user.userName" placeholder="username" />
<input v-model="user.password" type="password" placeholder="password" />
<button type="submit">Submit</button>

View File

@@ -10,7 +10,7 @@ import * as authApi from "../api/AuthApi";
const router = useRouter();
const user = reactive<RegisterDto>({ // the template ensures type consistency
username: "",
userName: "",
email: "",
password: "",
});
@@ -40,7 +40,7 @@ async function register(): Promise<void> {
<h2>Register</h2>
<form @submit.prevent="register">
<input v-model="user.username" placeholder="username" />
<input v-model="user.userName" placeholder="username" />
<input v-model="user.email" placeholder="email" />
<input v-model="user.password" placeholder="password" />

View File

@@ -26,7 +26,7 @@ function logout() {
<table>
<tr v-for="user in store.users" :key="user.id">
<td>{{ user.username }}</td>
<td>{{ user.userName }}</td>
<td>
<button @click="store.removeUser(user.id)">Delete</button>
</td>