mat
June 13, 2023, 2:39pm
1
supertokens-auth-react >= 0.32 deprecated canHandleRoute() used in Redwood Routes.tsx implementation.
if (SuperTokens.canHandleRoute()) {
return SuperTokens.getRoutingComponent()
}
See https://supertokens.com/docs/auth-react/0.31.X/modules/index.html
vs https://supertokens.com/docs/auth-react/0.32.X/modules/index.html
Redwood references 0.32.4 in @redwoodjs /auth-supertokens-web@npm:5.3.0
Do you plan to upgrade the code or pin to a previous version ?
dom
June 15, 2023, 10:34pm
2
@mat this sounds like a miss on our part—the PR upgrading supertokens (linked below) made it into v5.1.0 and should’ve been slated for the next major. I’ll work on reverting that in the next patch and save v0.32+ for Redwood v6.
redwoodjs:main
← redwoodjs:renovate/supertokens-auth-react-0.x
opened 06:17PM - 03 May 23 UTC
[](https://renova… tebot.com)
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [supertokens-auth-react](https://togithub.com/supertokens/supertokens-auth-react) | [`0.31.5` -> `0.32.1`](https://renovatebot.com/diffs/npm/supertokens-auth-react/0.31.5/0.32.1) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) |
---
### Release Notes
<details>
<summary>supertokens/supertokens-auth-react</summary>
### [`v0.32.1`](https://togithub.com/supertokens/supertokens-auth-react/blob/HEAD/CHANGELOG.md#​0321---2023-05-03)
[Compare Source](https://togithub.com/supertokens/supertokens-auth-react/compare/v0.32.0...v0.32.1)
##### Changes
- Made Session.validateClaims argument optional
### [`v0.32.0`](https://togithub.com/supertokens/supertokens-auth-react/blob/HEAD/CHANGELOG.md#​0320---2023-05-02)
[Compare Source](https://togithub.com/supertokens/supertokens-auth-react/compare/v0.31.5...v0.32.0)
##### Changes
- Eliminated the need for duplicate `init` call for non-react applications that use pre-built UI. [See the issue](https://togithub.com/supertokens/supertokens-auth-react/issues/616)
- Split/separate pre-built UI components from its recipe to reduce bundle sizes for apps that do not use pre-built UI
- Added thirdparty login with popup window example
##### Migration
##### Initializing web-js
This version also initializes the web-js SDK. If you previously did that manually, you can remove/replace it with the auth-react init call.
From this version forward, the recommended way to use this SDK, even with Angular and Vue, is to initialize auth-react in the root component. Importing `supertokens-auth-react` will not pull React into your main bundle; only importing the `prebuiltui` modules will.
For more details, check out our quick setup guides for angular and vue.
##### Adding the pre-built UI route for apps with react-router-dom
```tsx
import SuperTokens, { SuperTokensWrapper, getSuperTokensRoutesForReactRouterDom } from "supertokens-auth-react";
import Passwordless from "supertokens-auth-react/recipe/passwordless";
// .... other imports
SuperTokens.init({
appInfo: {
// appInfo
},
recipeList: [
Passwordless.init({
contactMethod: "EMAIL_OR_PHONE",
}),
Session.init(),
],
});
<SuperTokensWrapper>
<div className="App">
<Router>
<div className="fill">
<Routes>
{/* This shows the login UI on "/auth" route */}
{getSuperTokensRoutesForReactRouterDom(require("react-router-dom"))}
// ... other routes
</Routes>
</div>
<Footer />
</Router>
</div>
</SuperTokensWrapper>;
```
Should become
```tsx
import SuperTokens, { SuperTokensWrapper } from "supertokens-auth-react";
import { getSuperTokensRoutesForReactRouterDom } from "supertokens-auth-react/ui";
import Passwordless from "supertokens-auth-react/recipe/passwordless";
import { PasswordlessPreBuiltUI } from "supertokens-auth-react/recipe/passwordless/prebuiltui";
// .... other imports
SuperTokens.init({
appInfo: {
// appInfo
},
recipeList: [
Passwordless.init({
contactMethod: "EMAIL_OR_PHONE",
}),
Session.init(),
],
});
<SuperTokensWrapper>
<div className="App">
<Router>
<div className="fill">
<Routes>
{/* This shows the login UI on "/auth" route for Passwordless recipe */}
{getSuperTokensRoutesForReactRouterDom(require("react-router-dom"), [PasswordlessPreBuiltUI])}
// ... other routes
</Routes>
</div>
<Footer />
</Router>
</div>
</SuperTokensWrapper>;
```
##### Adding the pre-built UI route for apps without react-router-dom
```tsx
import React from "react";
import SuperTokens, { SuperTokensWrapper } from "supertokens-auth-react";
class App extends React.Component {
render() {
if (SuperTokens.canHandleRoute()) {
// This renders the login UI on the /auth route
return SuperTokens.getRoutingComponent();
}
return <SuperTokensWrapper>{/*Your app*/}</SuperTokensWrapper>;
}
}
```
Should become
```tsx
import { SuperTokensWrapper } from "supertokens-auth-react";
import { canHandleRoute, getRoutingComponent } from "supertokens-auth-react/ui";
import { PasswordlessPreBuiltUI } from "supertokens-auth-react/recipe/passwordless/prebuiltui";
class App extends React.Component {
render() {
if (canHandleRoute([PasswordlessPreBuiltUI])) {
// This renders the login UI on the /auth route
return getRoutingComponent([PasswordlessPreBuiltUI]);
}
return <SuperTokensWrapper>{/*Your app*/}</SuperTokensWrapper>;
}
}
```
</details>
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.
---
- [ ] If you want to rebase/retry this PR, check this box
---
This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/redwoodjs/redwood).
This release features two new experimental features you can try out; we'd love your feedback!
Render Modes (SSR, Streaming)
An experimental version of the original RFC, try out Render Modes and see...
dom
June 16, 2023, 12:18am
3
@mat I just released v5.3.1 that reverts the upgrade to this package: