-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactor custom framework utils to reuse them (#933)
* Add init util methods for custom framework support * Add some more changes for the custom framework re-usability * Expose custom framework * Update changelog and bump version * Add a fix for accessing SessionRecipe * Add init tests for the custom framework implementation * Update some variable names to match the custom framework definition * Add more tests for custom framework regarding withSession * Add tests for getSessionForSSR * Fix mochar related config and command * Add init changes to re-use functionality from custom framework in next * Fix export name for customframework and version * Add support for re-using duplicated code in nextjs from customframework * Reuse even more code from customframework into next.js * Reuse a customError handler in next * Update customFramework to handle JWT verification manually * Use internal functions for jwt parsing * Add a fix for accessing nextjs cookie extractor * Reuse an util function for getting JWK's * Reuse more functionality from custom framework in next * Add a comment about acceptin jwks as a parameter for getSessionForSSR * several fixes and refactoring * Fix custom framework related tests * Add/fix tests for next js * Add test for session refresh in next * Add test for core being down and error handler called in next * Add detail of breaking change in changelog * Adds migration guide for using updated next.js handler function --------- Co-authored-by: rishabhpoddar <[email protected]>
- Loading branch information
1 parent
1da2d3c
commit 0e21e6d
Showing
14 changed files
with
1,180 additions
and
723 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export * from "../lib/build/customFramework"; | ||
/** | ||
* 'export *' does not re-export a default. | ||
* import CustomFramework from "supertokens-node/custom"; | ||
* the above import statement won't be possible unless either | ||
* - user add "esModuleInterop": true in their tsconfig.json file | ||
* - we do the following change: | ||
*/ | ||
|
||
import * as _default from "../lib/build/customFramework"; | ||
export default _default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
exports.__esModule = true; | ||
__export(require("../lib/build/customFramework")); |
4 changes: 2 additions & 2 deletions
4
examples/next/with-emailpassword/app/api/auth/[...path]/route.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.