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

1 implement emailpassword auth #2

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

Conversation

Anish-Chanda
Copy link
Owner

Add Email password auth method with refresh tokens and sqlite3 default db support. Only supporting for argon2 hashing for now.

Copilot summary:

Authentication Service Implementation:

  • authS/authS.go: Added the AuthService struct and methods for handling email-password signup (EmailSignup), login (EmailLogin), and token refresh (HandleRefresh). This includes request validation, password hashing, token generation, and database interactions.

Configuration Setup:

  • config/config.go: Defined the Config struct to hold configuration settings such as JWT secrets, token TTLs, database configuration, and password hashing settings. Added a DefaultConfig function to provide default values.

Database Interface and Implementation:

  • db/interface.go: Created the Database interface with methods for checking email existence, managing users, and handling refresh tokens.
  • db/sqlite3/sqlite3.go: Implemented the Database interface for SQLite3, including methods for creating users, storing refresh tokens, and checking token revocation.

Utility Functions:

Example Application:

  • example/main.go: Created an example application to demonstrate the usage of the AuthService, including routes for signup, login, and token refresh.

These changes collectively establish a robust foundation for an authentication system with secure password handling and token-based session management.

@Anish-Chanda Anish-Chanda added this to the V0.1.0 milestone Nov 26, 2024
@Anish-Chanda Anish-Chanda self-assigned this Nov 26, 2024
@Anish-Chanda Anish-Chanda linked an issue Nov 26, 2024 that may be closed by this pull request
3 tasks
- handle errors in json encoding and tx rollbacks
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.

Implement Email/Password Auth
1 participant