Bunta Fujiwara (文太)
Bunta Fujiwara (文太)
CC#
Created by Bunta Fujiwara (文太) on 4/13/2024 in #help
✅ Can't Authenticate User
I am working on a small WebApp and I have 3 user types. In my EF DB Migration I defined the following tables: Logins, Users and another table called Roles. In the Logins table I hold an Id which is the same to the UserId, the email, hashed password and the password salt. In the Users table I hold all of the user data such as the name and a FK for the role. In the roles table I have an Id and RoleType string. Currently I have the "Standard" role and the "Administrator" role. I have an overview page for users that are not logged in that should not be visible to authenticated users. And the pages that are accessed by authenticated users are not visible for non-authenticated users. Meanwhile for the administrators I will provide the same pages but I may add more buttons, so the access should be similar (I assume). I have tried adding a cookie manually with the session, but I don't know how to authorize it. Next I tried adding custom policies, but that didn't work and I wasn't able to access any page. And now I tried adding Identity, but it seems like my Users and Roles tables/models are conflicting with the ones provided by Identity. What should I do? Here's how a user logs in into my application:
122 replies
CC#
Created by Bunta Fujiwara (文太) on 8/22/2023 in #help
❔ C# Database Query Optimization [Dapper & ReactJS]
I am currently working on a C# .NET app with React and I have a table of products in an overview page. I want the administrators to be able to just click and edit various entries in the table without being forced to re-use the Add Form. I want this to reduce the number of calls to the Database (because I'm obsessed with performance since I usually write C++). Now the problem with the table editing method is that I will require a State Pattern or a way to manage Session States, I've also just read that caching data is considered bad for web applications. How should I go about this?
55 replies