Request Provider Auth
Initiates an OAuth login flow, returning the provider's authentication URL.
Usage
Node.js / Next.js / Express.js
const { url } = await provider.auth.requestProviderAuth('google');Usage Note: You should redirect the user’s browser to the returned url.
Arguments
| Name | Type | Description |
|---|---|---|
provider | 'google' | 'github' | Required. The OAuth provider to use. |
Response
Type: Promise<{ url: string }>
Returns an object containing the provider’s redirect URL.
| Property | Type | Description |
|---|---|---|
url | string | The URL to redirect the user to (e.g., accounts.google.com…). |
Errors
PROVIDER_NOT_CONFIGURED: The Google (or Github) provider is not enabled.UNKNOWN_ERROR: An unknown error has occured.
GET https://api.productflame.com/v1/auth/google
Request
Headers
{ "Authorization": "<your_secret_api_key>"}Note: To initiate GitHub auth, replace /google with /github in the path.
Response Format
302 Found (Success)
The server responds with a HTTP Redirect.
- Location Header: Contains the provider’s authentication URL.
418 I’m a Teapot (Config Error)
{ "error": "PROVIDER_NOT_CONFIGURED", "message": "The Google provider is not enabled."}The Google provider is not enabled. (Or: “The Google clientId or the clientSecret or the callback is not valid.”)
500 Internal Server Error
{ "error": "UNKNOWN_ERROR", "message": "An unknown error has occured."}An unknown error has occured.