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

Return otpauth URL in the create user endpoint #52

Merged
merged 12 commits into from
Jan 30, 2025
Merged

Return otpauth URL in the create user endpoint #52

merged 12 commits into from
Jan 30, 2025

Conversation

kimitrii
Copy link
Owner

@kimitrii kimitrii commented Jan 30, 2025

Changes Made

This PR adds a new feature to the create user endpoint, enabling the generation of an OTP secret and returning an otpauth URL when the isTotpEnable input is true. This allows users to set up passwordless authentication using apps like Google Authenticator and Microsoft Authenticator.

Additionally, it fixes the Totp regex for user and service strings to allow dots and introduces the OTP_SECRET environment variable, which will be used as secret input for WebEncryptAES library to encrypt Totp generated secrets. A new database table has also been created to store OTP secrets, which are encrypted using WebEncryptAES before being saved, ensuring enhanced security during authentication.

Changes Type

  • Bug fix
  • New feature
  • Breaking change (When isTotpEnable is true in the create user endpoint, the successful response will return the otpauth URL)

Checklist:

  • The changes do not generate new error logs or warnings.
  • I have added tests that prove the fix or new feature works as expected.
  • Both new and existing tests pass locally.

@kimitrii kimitrii changed the title KimitriFix TOTP regex and add OTP_SECRET env variable for encryption Fix TOTP regex and add OTP_SECRET env variable for encryption Jan 30, 2025
@kimitrii kimitrii changed the title Fix TOTP regex and add OTP_SECRET env variable for encryption Return otpauth URL in the create user endpoint Jan 30, 2025
@kimitrii kimitrii merged commit b315ddc into main Jan 30, 2025
3 checks passed
kimitrii added a commit that referenced this pull request Jan 31, 2025
 Return otpauth URL in the create user endpoint #52
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