Skip to content

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
@Anish-Chanda Anish-Chanda marked this pull request as draft January 15, 2025 18:48
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

2 participants