Merge remote-tracking branch 'origin/main'

This commit is contained in:
2025-06-15 12:33:18 +03:30
2 changed files with 9 additions and 7 deletions
@@ -1,9 +1,10 @@
# Add a field in Database # Add a field in Database
- [ ] Add `User` field in `Roles` table - [ ] Add `User` field in `Roles` table using SSMS or Seed data in DbContext file
- [ ] Make sure the property `PersonId` is nullable in `Account`, so you can add fields related to "Person" later after registeration
# Branching # Branching
 - [ ] Create the feature/authentication branch based on develop - [ ] Create the feature/authentication branch based on develop
# Adjusting Account and Configurations # Adjusting Account and Configurations
@@ -380,6 +381,7 @@ System.IdentityModel.Tokens.Jwt
"ExpiryMinutes": 60 "ExpiryMinutes": 60
} }
``` ```
Note that you should fill the values as you wish - these are just samples
- [ ] Create `JwtSettings` and add the following method - [ ] Create `JwtSettings` and add the following method
📂 Suggested Folder: WebAPI/Authentication 📂 Suggested Folder: WebAPI/Authentication
@@ -404,7 +406,7 @@ string GenerateToken(AuthResponseDto authResponseDto);
📂 Suggested Folder: WebAPI/Authentication 📂 Suggested Folder: WebAPI/Authentication
use this project as a reference use this project as a reference
https://github.com/MehrdadShirvani/AlibabaClone-Backend/blob/develop/AlibabaClone.Application/Services/AuthService.cs https://github.com/MehrdadShirvani/AlibabaClone-Backend/blob/develop/AlibabaClone.WebAPI/Authentication/JwtGenerator.cs
## Configuring Jwt in Program.cs ## Configuring Jwt in Program.cs
@@ -1,6 +1,6 @@
# Branching # Branching
 - [ ] Create the feature/authentication branch based on develop - [ ] Create the feature/authentication branch based on develop
# Adding Models # Adding Models
Create three files inside this folder: Create three files inside this folder:
@@ -61,7 +61,7 @@ import {create} from 'zustand';
interface User { interface User {
  phoneNumber: string;   phoneNumber: string;
  roles: any;   roles: string[];
} }
@@ -161,7 +161,7 @@ This defines the overall structure of the authentication store:
## 🔹 Zustand Store Definition ## 🔹 Zustand Store Definition
```ts ```ts
export const useAuthStore = create<AuthState>((set) => ({ export const useAuthStore = create<AuthState>((set) => ({ ... });
``` ```
Creates a global auth store using Zustand. `create()` accepts a function that receives `set` (used to update state) and returns the initial store state and methods. Creates a global auth store using Zustand. `create()` accepts a function that receives `set` (used to update state) and returns the initial store state and methods.
@@ -368,7 +368,7 @@ interface LoginModalProps {
## 🔹 Component Setup ## 🔹 Component Setup
```tsx ```tsx
const LoginModal: React.FC<LoginModalProps> = ({ onClose }) => { const LoginModal: React.FC<LoginModalProps> = ({ onClose }) => { ... };
``` ```
Defines a functional React component with the `onClose` prop destructured. Defines a functional React component with the `onClose` prop destructured.