Currently, the code in the RedirectLoggedInUser and RequireAuth functions contains a lot of duplicated code, except for the redirect route. This duplication of code can lead to maintenance issues and make it difficult to maintain the codebase over time. Therefore, we need to refactor the code to avoid duplication.
The scope of this ticket includes:
Identifying the common code between the two functions.
Extracting the common code into a shared function that can be reused.
Testing the refactored code to ensure that it works as expected.
Currently, the code in the RedirectLoggedInUser and RequireAuth functions contains a lot of duplicated code, except for the redirect route. This duplication of code can lead to maintenance issues and make it difficult to maintain the codebase over time. Therefore, we need to refactor the code to avoid duplication.
The scope of this ticket includes: