Skip to content

Conversation

@mekarpeles
Copy link
Member

@mekarpeles mekarpeles commented Nov 18, 2025

This pull request introduces a "beta" flow for user authentication, adding support for HTML-based OTP (One Time Password) authentication forms and improved handling of user authentication in the API. The changes include new HTML templates, conditional template rendering, and logic for redirecting users after successful authentication. Additionally, error logging and handling for OTP issuance have been improved.

Beta HTML Authentication Flow:

  • Added new HTML templates auth.html and otp_redeem.html for email and OTP input forms, enabling a browser-based authentication experience when the beta parameter is present. [1] [2]
  • Updated authentication routes to render these templates when the beta parameter is detected, both for initial email entry and OTP redemption. [1] [2]
  • After successful OTP verification in beta mode, users are redirected to perform the requested action (e.g., borrow) on the specified book.

OTP Issuance and Logging Improvements:

  • Improved error handling in the OTP issuance process by logging the response content and returning the JSON response explicitly.
  • Enhanced request body parsing in the authentication route to support both JSON and form data, improving robustness for different client types.

@mekarpeles
Copy link
Member Author

mekarpeles commented Nov 18, 2025

This shouldn't be merged, however this code block is absolutely needed:

https://github.com/ArchiveLabs/lenny/pull/123/files#diff-daea9adfc6a724cd61b2c765b7ed1e9d21712d5bd3fce17212f4e66af731abcfR85-R90

EDIT: The above snippet has been merged in #124

@mekarpeles mekarpeles force-pushed the authflow branch 3 times, most recently from 62869ae to 4173457 Compare December 5, 2025 05:19
@mekarpeles mekarpeles marked this pull request as ready for review December 5, 2025 05:32
@mekarpeles mekarpeles merged commit 7821e6f into main Dec 5, 2025
2 checks passed
@mekarpeles mekarpeles deleted the authflow branch December 5, 2025 05:34
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.

2 participants