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

[Closes #39, Closes #48] API client can authenticate a user by email/password, test db fixtures helper added #65

Merged
merged 18 commits into from
Mar 30, 2024

Conversation

francisli
Copy link
Contributor

No description provided.

@francisli francisli linked an issue Mar 28, 2024 that may be closed by this pull request
@francisli francisli marked this pull request as draft March 28, 2024 23:01
@francisli
Copy link
Contributor Author

@michaelyshih

Implementing CSRF tokens involves adding an additional request to get a token before submitting.

But I'm still not convinced we actually need them to mitigate CSRF attacks. If we use the SameSite=strict setting on our cookies cookie, then browsers will not send the cookie when a request is initiated on a different (i.e. attacker's) site.

Also, since our API is a JSON-based API, they can only be invoked from XMLHttpRequests (i.e. not form submissions), which are also subject to CORS settings, which also restrict the ability for attackers to call the API from different (i.e. attacker) sites.

So I think we can reduce the complexity of our API by removing the CRSF related code...

@francisli francisli changed the title [Closes #39] WIP API client can authenticate a user by email/password [Closes #39] API client can authenticate a user by email/password Mar 29, 2024
@francisli francisli changed the title [Closes #39] API client can authenticate a user by email/password [Closes #39, Closes #48] API client can authenticate a user by email/password, test db fixtures helper added Mar 29, 2024
@francisli francisli marked this pull request as ready for review March 29, 2024 23:02
@francisli francisli merged commit 2583395 into dev Mar 30, 2024
1 check passed
@francisli francisli deleted the 39-api-client-can-authenticate-a-user-by-emailpassword branch March 30, 2024 01:16
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.

API client can authenticate a User by email/password
2 participants