Skip to content

Commit 2b276a4

Browse files
authored
docs (social authentication): Bring to attention the clearParams method (#162)
1 parent 86dfad4 commit 2b276a4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

content/docs/authentication/social_authentication.md

+16
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,22 @@ router.get('/google/redirect', async ({ ally }) => {
282282
})
283283
```
284284
285+
You can clear any existing parameters using the `.clearParam()` method on the request. This can be helpful if parameter defaults are defined in the config and you need to redefine them for a separate custom auth flow.
286+
287+
```ts
288+
router.get('/google/redirect', async ({ ally }) => {
289+
return ally
290+
.use('google')
291+
.redirect((request) => {
292+
// highlight-start
293+
request
294+
.clearParam('redirect_uri')
295+
.param('redirect_uri', '')
296+
// highlight-end
297+
})
298+
})
299+
```
300+
285301
## Fetching user details from an access token
286302
Sometimes, you might want to fetch user details from an access token stored in the database or provided via another OAuth flow. For example, you used the Native OAuth flow via a mobile app and received an access token back.
287303

0 commit comments

Comments
 (0)