Skip to content

Commit

Permalink
Replace redirectMode with redirectMethod in MIGRATION_GUIDE (#1047)
Browse files Browse the repository at this point in the history
  • Loading branch information
frederikprijck committed Nov 15, 2022
1 parent 70a177c commit faa3842
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ With the v2 release of Auth0-SPA-JS, we have improved both performance and devel
- [buildAuthorizeUrl has been removed](#buildauthorizeurl-has-been-removed)
- [buildLogoutUrl has been removed](#buildlogouturl-has-been-removed)
- [localOnly logout has been removed, and replaced by onRedirect](#localonly-logout-has-been-removed-and-replaced-by-onredirect)
- [redirectMode has been removed from loginWithRedirect](#redirectmode-has-been-removed-from-loginwithredirect)
- [redirectMethod has been removed from loginWithRedirect](#redirectmethod-has-been-removed-from-loginwithredirect)
- [ignoreCache on getTokenSilentlyhas been replaced by cacheMode](#ignorecache-on-gettokensilentlyhas-been-replaced-by-cachemode)
- [application/x-www-form-urlencoded is used by default instead of application/json](#applicationx-www-form-urlencoded-is-used-by-default-instead-of-applicationjson)
- [No more iframe fallback by default when using refresh tokens](#no-more-iframe-fallback-by-default-when-using-refresh-tokens)
Expand Down Expand Up @@ -197,17 +197,17 @@ client.logout({
});
```

### `redirectMode` has been removed from `loginWithRedirect`
### `redirectMethod` has been removed from `loginWithRedirect`

In v1, Auth0Client’s `loginWithRedirect` takes a `redirectMode` that can be set to any of `assign` and `replace`, allowing the users to control whether the SDK should redirect using `window.location.assign` or `window.location.replace`.
In v1, Auth0Client’s `loginWithRedirect` takes a `redirectMethod` that can be set to any of `assign` and `replace`, allowing the users to control whether the SDK should redirect using `window.location.assign` or `window.location.replace`.

```ts
await client.loginWithRedirect({
redirectMode: 'replace'
redirectMethod: 'replace'
});
```

With the release of v2, we have removed `redirectMode`. If you want to use anything but `window.location.assign` to handle the redirect to Auth0, you should implement `onRedirect`:
With the release of v2, we have removed `redirectMethod`. If you want to use anything but `window.location.assign` to handle the redirect to Auth0, you should implement `onRedirect`:

```ts
await client.loginWithRedirect({
Expand Down

0 comments on commit faa3842

Please sign in to comment.