Skip to content

Commit

Permalink
signIn API + feature events
Browse files Browse the repository at this point in the history
  • Loading branch information
kant01ne committed Oct 26, 2020
1 parent 0af3f21 commit 79523a2
Show file tree
Hide file tree
Showing 30 changed files with 1,545 additions and 119 deletions.
21 changes: 7 additions & 14 deletions lib/build/components/superTokensRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,6 @@ function _interopRequireWildcard(obj) {
/*
* Imports.
*/

/*
* SuperTokensRouteWithRecipeId
* Using react-router-dom, we can only match based on the route and not on the combination of path and query params.
* having one route per component would lead to clashes when two components have the same route but different recipeId,
* the first one would always take precedence.
* Hence, the component rendered in the Route is an abstraction that decides which Feature to render based
* on the rId.
* See SuperTokensRouteWithRecipeId below.
*/
function getSuperTokensRoutesForReactRouterDom() {
try {
var pathsToComponentWithRecipeIdMap = _superTokens["default"].getPathsToComponentWithRecipeIdMap();
Expand All @@ -108,21 +98,24 @@ function getSuperTokensRoutesForReactRouterDom() {
});
});
} catch (e) {
// If react-router-dom is absent from dependencies, return [];
return [];
}
}

function SuperTokensRouteWithRecipeId(props) {
function SuperTokensRouteWithRecipeId(_ref) {
var path = _ref.path;

var Route = require("react-router-dom").Route;

var recipeId = (0, _utils.getRecipeIdFromSearch)(window.location.search);

var component = _superTokens["default"].getMatchingComponentForRouteAndRecipeId(props.path, recipeId);
var component = _superTokens["default"].getMatchingComponentForRouteAndRecipeId(path, recipeId);

return /*#__PURE__*/ React.createElement(Route, {
exact: true,
key: "st-".concat(props.path),
path: props.path,
key: "st-".concat(path),
path: path,
component: component
});
}
11 changes: 11 additions & 0 deletions lib/build/httpRequest.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

310 changes: 310 additions & 0 deletions lib/build/httpRequest.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/build/normalisedURLDomain.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 79523a2

Please sign in to comment.