-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code Review #10
base: code-review
Are you sure you want to change the base?
Code Review #10
Conversation
…isolation and efficiency Migrated the complete build pipeline of our monorepo to Docker containers, leveraging multi-stage builds for optimized performance. This shift ensures full isolation from the local environment, enhancing consistency and scalability.
Authentication mechanism for efficient user verification. This update includes token generation, validation, and automated handling of token expiry and refresh scenarios.
Refactor Dto and add error message for incorrect request Delete unnecessary filter chain in AuthTokenFilter Delete unused TokenDto
Implement Backend with JWT Authentication
Add a AES encryption and decryption module including controller, service, and repository layers. This module provides functionalities to securely encrypt and decrypt messages using AES algorithm
- browser behavior realize me what filterChain really do - exceptionHandling cause that browser client get 401 on bad auth instead of 200
BREAKING CHANGE: Issue with Handling Multiple Clients Using a Single Account: storage token
fixed unexcepted behavior in browser
refactor(MessageController): Add response entity
- added hook for auth - login/register page - simple router logic - error page
…error handling via toasts
Feature/login page
- Added registration, login, and logout functionality for improved user experience. - Updated dashboard with a backend-connected table and hover cards for extended text. - Improved error handling for smoother user interactions across authentication and dashboard usage. - encryption and decryption logic
feat(frontend): Enhance auth flow, dashboard, and error handling
Full Stack
Added max 140 char length because of encryption
Full Stack
} | ||
|
||
@NotBlank(message = "The email is required.") | ||
@Pattern(regexp = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", message = "Invalid email address.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wszystkie regexy do stałych w osobnej klasie
import lombok.*; | ||
|
||
@EqualsAndHashCode(callSuper = true) | ||
@Data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
na Entity lepiej nie stosować @DaTa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(user.getUsername(), request.getPassword())); | ||
//@TODO only one user can be logged in at the same time | ||
revokeAndDeleteAllUserTokens(user); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
czemu nie może być 2 sesji na raz?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jeśli przy logowaniu/rejestracji usuwam/bądź unieważniam tokeny dostępne w bazie danego użytkownika to koliduje.
Tu chodzi o to, że jeden użytkownik nie może być zalogowany np. na 2 urządzeniach
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tokenów JWT lepiej nie trzymać w bazie bo szybko sie zawali, można trzymać w pamięci i co restart backendu tworzyć nowy JWT secret.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
początkowo chciałem usuwać co logowanie ale pojawił się problem 2 sesji jednego użytkownika czego nie przewidziałem. Co do JWT secret to racja. Nie jestem przekonany co do trzymania tokenów w ramie to też szybko można zawalić
const router = createBrowserRouter([ | ||
{ | ||
path: "/", | ||
element: <Navigate to="/login" replace/>, | ||
}, | ||
{ | ||
path: "/login", | ||
element: ( | ||
<> | ||
<LoginPage/> | ||
<Toaster/> | ||
</> | ||
) | ||
}, | ||
{ | ||
path: "/dashboard", | ||
element: ( | ||
<RequireAuth> | ||
<Dashboard/> | ||
<Toaster/> | ||
<div className="absolute left-5 top-5"> | ||
<Logout/> | ||
</div> | ||
</RequireAuth> | ||
), | ||
}, | ||
{ | ||
path: "*", | ||
element: <PageNotFound/>, | ||
}, | ||
]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do osobnego componentu
const {toast} = useToast(); | ||
const [dialogOpen, setDialogOpen] = useState(false); | ||
|
||
const onSubmit: SubmitHandler<EncryptRequest> = async (data) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zapytania do api do osobnych hooków, najlepiej z react query
No description provided.