docs: document dependencies for auth provider (#10865)
* docs: document dependencies for auth provider * fixes * document overriding callback url
This commit is contained in:
@@ -110,7 +110,7 @@ The third-party service authentication method requires using the `authenticate`
|
||||
|
||||
```ts
|
||||
const { success, authIdentity, location } = await authModuleService.authenticate(
|
||||
"emailpass",
|
||||
"google",
|
||||
// passed to auth provider
|
||||
{
|
||||
// ...
|
||||
@@ -134,6 +134,21 @@ For example, when using the `google` provider, the `location` is the URL that th
|
||||
|
||||

|
||||
|
||||
### Overriding Callback URL
|
||||
|
||||
The Google and GitHub providers allow you to override their `callbackUrl` option during authentication. This is useful when you redirect the user after authentication to a URL based on its actor type. For example, you redirect admin users and customers to different pages.
|
||||
|
||||
```ts
|
||||
const { success, authIdentity, location } = await authModuleService.authenticate(
|
||||
"google",
|
||||
// passed to auth provider
|
||||
{
|
||||
// ...
|
||||
callback_url: "example.com"
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
### validateCallback
|
||||
|
||||
Providers handling this authentication flow must implement the `validateCallback` method. It implements the logic to validate the authentication with the third-party service.
|
||||
|
||||
Reference in New Issue
Block a user