Skip to main content

User Authentication and Management

R2R provides a comprehensive set of user authentication and management features, allowing you to implement secure and feature-rich authentication systems in your applications.

User Registration

To register a new user:
object

Email Verification

If email verification is enabled, verify a user’s email:
object

User Login

To log in and obtain access tokens:
object

Get Current User Info

Retrieve information about the currently authenticated user:
dict

Refresh Access Token

Refresh an expired access token:
object

Change Password

Change the user’s password:
object

Request Password Reset

Request a password reset for a user:
object

Confirm Password Reset

Confirm a password reset using the reset token:
object

Update User Profile

Update the user’s profile information:
dict

Delete User Account

Delete the user’s account:
dict

User Logout

Log out and invalidate the current access token:
object

Superuser Capabilities

Superusers have additional privileges, including access to system-wide operations and sensitive information. To use superuser capabilities, authenticate as a superuser or the default admin:
Superuser actions should be performed with caution and only by authorized personnel. Ensure proper security measures are in place when using superuser capabilities.

Security Considerations

When implementing user authentication, consider the following best practices:
  1. Always use HTTPS in production to encrypt data in transit.
  2. Implement rate limiting to protect against brute-force attacks.
  3. Use secure password hashing (R2R uses bcrypt by default).
  4. Consider implementing multi-factor authentication (MFA) for enhanced security.
  5. Conduct regular security audits of your authentication system.
For more advanced use cases or custom implementations, refer to the R2R documentation or reach out to the community for support.