OAuthModule class

Module for handling OAuth authentication.

This module provides methods for authenticating users through OAuth providers like Google, GitHub, and others.

Obtain an instance from BetterAuthClient.oauth:

final response = await authClient.oauth.signIn(
  provider: 'google',
  callbackUrlScheme: 'myapp',
);

Platform Configuration

iOS

Add the following to your Info.plist:

<key>CFBundleURLTypes</key>
<array>
  <dict>
    <key>CFBundleURLSchemes</key>
    <array>
      <string>myapp</string>
    </array>
  </dict>
</array>

Android

Add the following to your android/app/src/main/AndroidManifest.xml:

<intent-filter>
  <action android:name="android.intent.action.VIEW" />
  <category android:name="android.intent.category.DEFAULT" />
  <category android:name="android.intent.category.BROWSABLE" />
  <data android:scheme="myapp" />
</intent-filter>

Constructors

OAuthModule(Dio _dio, StorageInterface _storage)
Creates a new OAuthModule instance.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
signIn({required String provider, required String callbackUrlScheme}) Future<AuthResponse<Session>>
Initiates an OAuth sign-in flow.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited