Skip to content

Oauth Support - v0.1.1

Compare
Choose a tag to compare
@martyn martyn released this 04 Sep 05:38
· 1 commit to main since this release

New Features:
OAuth Support:

Added OAuth authentication functionality to the library, allowing users to sign up and log in via OAuth providers.
New methods:
login_oauth(provider, oauth_id): Log in using an OAuth provider and OAuth ID.
signup_oauth(provider, oauth_id, **insert_args): Sign up using an OAuth provider and OAuth ID, with support for additional user attributes.
Custom Errors:

Introduced UserExistsError, a custom error class that is raised when a user already exists during the sign-up process.
Refinements to Database Schema:

Added new columns to the user table to support OAuth-based sign-ins:
oauth_provider: Stores the OAuth provider used for authentication.
oauth_id: Unique ID from the OAuth provider for each user.
Updated schema migration logic to ensure smooth integration of OAuth support without affecting existing user accounts.
Password Handling Enhancements:

Strengthened the password validation mechanism by adding checks during the sign-up process.
Adjusted sign-up function to dynamically handle additional insert arguments for flexibility.
JWT Enhancements:

Updated JWT generation (_generate_jwt) to handle optional email fields, which is particularly useful for OAuth-based sign-ups where an email might not always be provided.
Bug Fixes:
Fixed a minor issue with SQL query formatting when dealing with table names containing the public schema.
Deprecations:
None.