diff --git a/api/src/Controllers/AuthController.cs b/api/src/Controllers/AuthController.cs index 05c4efd..6daca44 100644 --- a/api/src/Controllers/AuthController.cs +++ b/api/src/Controllers/AuthController.cs @@ -45,7 +45,7 @@ public class AuthController : ControllerBase { [HttpPost("login")] public async Task Login(LoginDto dto) { - var user = await users_.Get(dto.UserName); + var user = await userManager_.FindByNameAsync(dto.UserName); if (user == null) return Unauthorized(); diff --git a/client/src/components/UsersTable.vue b/client/src/components/UsersTable.vue index b9c87e0..76ec2b9 100644 --- a/client/src/components/UsersTable.vue +++ b/client/src/components/UsersTable.vue @@ -21,7 +21,7 @@ onMounted(() => { // register callback for when component is loaded on page - +
{{ user.name }}{{ user.username }} Edit diff --git a/client/src/models/User.ts b/client/src/models/User.ts index 6bc0c95..48d8fcd 100644 --- a/client/src/models/User.ts +++ b/client/src/models/User.ts @@ -4,18 +4,18 @@ export interface User { id: number; - name: string; + username: string; email: string; password: string; } export interface RegisterDto { - name: string; + username: string; email: string; password: string; } export interface LoginDto { - name: string; + username: string; password: string; } diff --git a/client/src/pages/LoginForm.vue b/client/src/pages/LoginForm.vue index 7f79c15..04f7e79 100644 --- a/client/src/pages/LoginForm.vue +++ b/client/src/pages/LoginForm.vue @@ -10,7 +10,7 @@ import * as authApi from "../api/AuthApi"; const router = useRouter(); const user = reactive({ // the template ensures type consistency - name: "", + username: "", password: "", }); @@ -38,7 +38,7 @@ async function login(): Promise {

Login

- + diff --git a/client/src/pages/RegisterForm.vue b/client/src/pages/RegisterForm.vue index 97a904e..28a461c 100644 --- a/client/src/pages/RegisterForm.vue +++ b/client/src/pages/RegisterForm.vue @@ -10,7 +10,7 @@ import * as authApi from "../api/AuthApi"; const router = useRouter(); const user = reactive({ // the template ensures type consistency - name: "", + username: "", email: "", password: "", }); @@ -40,7 +40,7 @@ async function register(): Promise {

Register

- + diff --git a/client/src/pages/UserForm.vue b/client/src/pages/UserForm.vue index 75079bf..7b70f23 100644 --- a/client/src/pages/UserForm.vue +++ b/client/src/pages/UserForm.vue @@ -14,7 +14,7 @@ const router = useRouter(); const user = ref({ id: 0, - name: "", + username: "", email: "", password: "" }); @@ -46,7 +46,7 @@ async function save(): Promise {

{{ id ? "Edit User" : "Create User" }}

- + diff --git a/client/src/pages/UsersList.vue b/client/src/pages/UsersList.vue index 342b4b9..35185e2 100644 --- a/client/src/pages/UsersList.vue +++ b/client/src/pages/UsersList.vue @@ -28,7 +28,7 @@ function logout() { - +
{{ user.name }}{{ user.username }} diff --git a/scripts/DEV_README.md b/scripts/DEV_README.md new file mode 100644 index 0000000..bfee97f --- /dev/null +++ b/scripts/DEV_README.md @@ -0,0 +1,24 @@ + +## These are some notes for development +# contains some helpful tips, commands, and knowledge + +Resetting the database (for dev): +> set development evironment (specify non-docker network and db password) +> dotnet ef database drop +> dotnet ef migrations remove +> if above errors, dotnet ef database update 0 +> dotnet ef migrations add InitialCreate + +To see live logs: +sudo docker logs -f -t agologum-api + +public user: +> username=bard +> password=Public*890 + +chrome dev tools troubleshooting +> response body: Network => url endpoint => Response => expand + +Always test build before committing +> for the client: $ npm run dev +> for the api: $ dotnet build diff --git a/scripts/notes.txt b/scripts/notes.txt deleted file mode 100644 index 8ff218c..0000000 --- a/scripts/notes.txt +++ /dev/null @@ -1,8 +0,0 @@ - -Resetting the database (for dev): -> set development evironment (specify non-docker network and db password) -> dotnet ef database drop -> dotnet ef migrations remove -> if above errors, dotnet ef database update 0 -> dotnet ef migrations add InitialCreate -