Skip to content
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

Centralize authentication process #598

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Conversation

JVT038
Copy link
Collaborator

@JVT038 JVT038 commented Mar 2, 2024

In this PR I have attempted to centralize the authentication process by creating a new ValueObject called AuthenticationObject.

This object has three properties, namely the token itself, the authentication method and the userEntity of the authenticated user.

Three new methods have been created to create this new authentication object. One method for creating the object with cookie authentication, one method for creating it with the token stored inside the X-Movary-Token header and one 'dynamic' method to create the object with either the header or the cookie. So the dynamic method first checks the cookie for the token and if it doesn't exist, it'll check the HTTP header for the token.

Also, the methods all check both the user_auth_token and the user_api_token table for the token.

JVT038 added 2 commits March 2, 2024 12:55
Signed-off-by: JVT038 <47184046+JVT038@users.noreply.github.com>
Signed-off-by: JVT038 <47184046+JVT038@users.noreply.github.com>
@JVT038 JVT038 requested a review from leepeuker as a code owner March 2, 2024 12:00
JVT038 added 2 commits March 2, 2024 13:05
Signed-off-by: JVT038 <47184046+JVT038@users.noreply.github.com>
Signed-off-by: JVT038 <47184046+JVT038@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant