Skip to content

Commit

Permalink
feat!: Integrate supertokens-web-js (#464)
Browse files Browse the repository at this point in the history
* feat!: Implement web-js email verification recipe (#382)

* Implement web-js email verification recipe

* Add network response to recipe function return types

* Update CHANGELOG

* Update size limits

* Create webjs instance in recipe constructor instead of recipe implementation

* Export all recipe implementation functions from recipe/index

* Update CHANGELOG

* Refactor based on PR comments

* Refactor code based on type changes in web-js

* Export email verification functions from other recipes

* Update types to include action in PostAPIHookContext

* Update size limit for third party recipe

* feat!: Integrate emailpassword recipe from supertokens-web-js (#389)

* Use direct imports for NormalisedURLDomain and Path instead of /lib/build from supertokens-web-js

* Modify email password to use recipe from web-js

* Refactor when calling doesEmailExist

* Add general error handling for email password and fix for fields logic for submitNewPassword

* Change web-js to use 0.0 branch

* Update CHANGELOG

* Update size check

* Update CHANGELOG and refactor based on PR comments

* Integrate web-js third party recipe

* Refactor based on changes in web-js thirdparty recipe

* Refactor based on changes in web-js thirdparty recipe

* Refactor based on changes in web-js

* Update for-tests app

* Fix using redirectToPath from state stored in session storage

* Remove recipe interface and use types from webjs for emailverification

* Add thirdpartyemailpassword recipe and remove recipe interfaces from auth react

* Update gitattributes

* Refactor based on web-js changes and remove unnecessary recipe implementation folder

* Fix logic for general error

* Initialise sub recipes and add on handle event code

* Remove console log

* Update size limit

* Update CHANGELOG

* Export email password recipe functions from tpep

* Export third party recipe functions from tpep

* Update CHANGELOG

* Integrate web-js session recipe and remove dependancy from supertokens-website

* Refactor based on changed in web-js

* Refactor based on changes in web-js

* Refactor based on PR review

* Add user context provider

* Refactor

* Refactor

* Refactor based on PR reviews

* feat!: Integrate third party and third party email password recipes from supertokens-web-js (#393)

* Integrate web-js third party recipe

* Refactor based on changes in web-js thirdparty recipe

* Refactor based on changes in web-js thirdparty recipe

* Refactor based on changes in web-js

* Update for-tests app

* Fix using redirectToPath from state stored in session storage

* Remove recipe interface and use types from webjs for emailverification

* Add thirdpartyemailpassword recipe and remove recipe interfaces from auth react

* Update gitattributes

* Refactor based on web-js changes and remove unnecessary recipe implementation folder

* Fix logic for general error

* Initialise sub recipes and add on handle event code

* Remove console log

* Update size limit

* Update CHANGELOG

* Export email password recipe functions from tpep

* Export third party recipe functions from tpep

* Update CHANGELOG

* Refactor based on changes in web-js

* Refactor based on PR review

* Refactor

* Refactor based on PR reviews

* Update CHANGELOG

* Add user context as a prop

* Add userContext unit tests for emailpassword and thirdparty

* Add end to end test for user context with ResetPasswordUsingToken component

* Use latest web-js

* Use latest web-js

* Add UI tests for using user context with third party email password

* Refactor for tests

* Add userContext to onhandleEvemt

* feat: Replace supertokens-website for session recipe with supertokens-web-js (#398)

* Integrate web-js third party recipe

* Refactor based on changes in web-js thirdparty recipe

* Refactor based on changes in web-js thirdparty recipe

* Refactor based on changes in web-js

* Update for-tests app

* Fix using redirectToPath from state stored in session storage

* Remove recipe interface and use types from webjs for emailverification

* Add thirdpartyemailpassword recipe and remove recipe interfaces from auth react

* Update gitattributes

* Refactor based on web-js changes and remove unnecessary recipe implementation folder

* Fix logic for general error

* Initialise sub recipes and add on handle event code

* Remove console log

* Update size limit

* Update CHANGELOG

* Export email password recipe functions from tpep

* Export third party recipe functions from tpep

* Update CHANGELOG

* Integrate web-js session recipe and remove dependancy from supertokens-website

* Refactor based on changed in web-js

* Refactor based on changes in web-js

* Refactor based on PR review

* Refactor

* Refactor based on PR reviews

* Update CHANGELOG

* Use latest web-js

* Use latest web-js

* Add userContext to onhandleEvemt

* Add userContext to getSessionContext

* Update changelog

* Integrate web-js passwordless recipe

* Refactor

* Refactor user context changes

* Refactor the way user context is handled for UI components

* Fix based on PR comments

* Use latest web-js and refactor callAPI error handling

* Add UserContextWrapper for SessionAuth

* Add UserContextWrapper to EmailVerificationAuth

* Explicitly pass userContext as undefined for SessionAuth and EmailVerificationAuth

* Refactor user context to also provide a function for updating it

* Refactor to fix tests

* Refactor

* Changes based on PR review

* Remove passing userContext as undefined

* feat: Add the ability to pass userContext to pre-built UI components (#399)

* Integrate web-js third party recipe

* Refactor based on changes in web-js thirdparty recipe

* Refactor based on changes in web-js thirdparty recipe

* Refactor based on changes in web-js

* Update for-tests app

* Fix using redirectToPath from state stored in session storage

* Remove recipe interface and use types from webjs for emailverification

* Add thirdpartyemailpassword recipe and remove recipe interfaces from auth react

* Update gitattributes

* Refactor based on web-js changes and remove unnecessary recipe implementation folder

* Fix logic for general error

* Initialise sub recipes and add on handle event code

* Remove console log

* Update size limit

* Update CHANGELOG

* Export email password recipe functions from tpep

* Export third party recipe functions from tpep

* Update CHANGELOG

* Integrate web-js session recipe and remove dependancy from supertokens-website

* Refactor based on changed in web-js

* Refactor based on changes in web-js

* Refactor based on PR review

* Add user context provider

* Refactor

* Refactor

* Refactor based on PR reviews

* Update CHANGELOG

* Add user context as a prop

* Add userContext unit tests for emailpassword and thirdparty

* Add end to end test for user context with ResetPasswordUsingToken component

* Use latest web-js

* Use latest web-js

* Add UI tests for using user context with third party email password

* Refactor for tests

* Add userContext to onhandleEvemt

* Update changelog

* Refactor user context changes

* Refactor the way user context is handled for UI components

* Fix based on PR comments

* Add UserContextWrapper for SessionAuth

* Add UserContextWrapper to EmailVerificationAuth

* Explicitly pass userContext as undefined for SessionAuth and EmailVerificationAuth

* Refactor user context to also provide a function for updating it

* Refactor to fix tests

* Changes based on PR review

* Remove passing userContext as undefined

* Use latest web-js

* Update CHANGELOG

* Update based on changes in web-js

* Use latest web-js

* Changes based on PR review

* Add util method for setLoginAttemptInfo

* Refactor based on PR review

* Use latest web-js

* Refactor STGeneralError handling

* Refactor based on PR review

* Refactor general error handling

* feat!: Integrate passwordless recipe from web-js SDK (#402)

* Integrate web-js third party recipe

* Refactor based on changes in web-js thirdparty recipe

* Refactor based on changes in web-js thirdparty recipe

* Refactor based on changes in web-js

* Update for-tests app

* Fix using redirectToPath from state stored in session storage

* Remove recipe interface and use types from webjs for emailverification

* Add thirdpartyemailpassword recipe and remove recipe interfaces from auth react

* Update gitattributes

* Refactor based on web-js changes and remove unnecessary recipe implementation folder

* Fix logic for general error

* Initialise sub recipes and add on handle event code

* Remove console log

* Update size limit

* Update CHANGELOG

* Export email password recipe functions from tpep

* Export third party recipe functions from tpep

* Update CHANGELOG

* Integrate web-js session recipe and remove dependancy from supertokens-website

* Refactor based on changed in web-js

* Refactor based on changes in web-js

* Refactor based on PR review

* Add user context provider

* Refactor

* Refactor

* Refactor based on PR reviews

* Update CHANGELOG

* Add user context as a prop

* Add userContext unit tests for emailpassword and thirdparty

* Add end to end test for user context with ResetPasswordUsingToken component

* Use latest web-js

* Use latest web-js

* Add UI tests for using user context with third party email password

* Refactor for tests

* Add userContext to onhandleEvemt

* Update changelog

* Integrate web-js passwordless recipe

* Refactor

* Refactor user context changes

* Refactor the way user context is handled for UI components

* Fix based on PR comments

* Use latest web-js and refactor callAPI error handling

* Add UserContextWrapper for SessionAuth

* Add UserContextWrapper to EmailVerificationAuth

* Explicitly pass userContext as undefined for SessionAuth and EmailVerificationAuth

* Refactor user context to also provide a function for updating it

* Refactor to fix tests

* Refactor

* Changes based on PR review

* Remove passing userContext as undefined

* Use latest web-js

* Update CHANGELOG

* Update based on changes in web-js

* Use latest web-js

* Changes based on PR review

* Add util method for setLoginAttemptInfo

* Refactor based on PR review

* Use latest web-js

* Refactor STGeneralError handling

* Refactor based on PR review

* Refactor general error handling

* Merge 0.20

* Regenerate package-lock for test server

* Fix tests

* Integrate thirdpartypasswordless from web-js

* Update size limit

* Update CHANGELOG for passwordless

* Export recipe functions from thirdpartypasswordless index

* Update CHANGELOG for thirdpartypasswordless

* Refactor based on changes in supertokens-web-js

* Fix function names in for-tests example app

* Fix method names in for-tests thirdpartypasswordless

* Refactor based on changes in web-js

* feat!: Integrate thirdpartypasswordless from web-js SDK (#411)

* Integrate thirdpartypasswordless from web-js

* Update size limit

* Update CHANGELOG for passwordless

* Export recipe functions from thirdpartypasswordless index

* Update CHANGELOG for thirdpartypasswordless

* Refactor based on changes in supertokens-web-js

* Fix function names in for-tests example app

* Fix method names in for-tests thirdpartypasswordless

* Use util functions from web-js for passwordless

* Use latest web-js

* Use latest web-js

* Refactor based on changes in web-js

* Update to web-js 0.0 and update test workflow

* Update to web-js 0.0 and update test workflow

* Update to web-js 0.0 and update test workflow

* Update to web-js 0.0 and update test workflow

* Update to web-js 0.0 and update test workflow

* Update to web-js 0.0 and update test workflow

* Remove querier and modify prune script

* Remove supported_fdi

* Refactor querier test to use Querier from web-js

* Rename disableDefaultImplementation to disableDefaultUI

* Update CHANGELOG

* Rename disableDefaultImplementation to disableDefaultUI for tests

* refactor: Use web-js input type for session recipe (#422)

* Use web-js input type for session recipe

* Update size limit

* refactor: Remove Querier from supertokens-auth-react (#424)

* Remove querier and modify prune script

* Remove supported_fdi

* Refactor querier test to use Querier from web-js

* Add mock for response.clone to unit test

* Fix querier test with latest web-js

* Delete querier tests

* refactor: Rename disableDefaultImplementation to disableDefaultUI in the query params in the testing environment and example apps (#426)

* Rename disableDefaultImplementation to disableDefaultUI for query params during testing

* Rename disableDefaultImplementation to disableDefaultUI for example apps

* Revert property change for example apps other than test

* Add general error handling for email verification

* Add test to check for general error in verifyEmailLinkClicked screen

* Fix logic for general error handling for verifyEmailLinkClicked component

* Add test to check for general error in sendVerifyEmail screen

* Update CHANGELOG

* Use web-js 0.0

* refactor: Refactor imports from supertokens-web-js to not use build paths directly (#432)

* Refactor types for importing STGeneralError

* Refactor imports for recipe types from web-js

* Refactor import for recipeModule and session recipe from web-js

* Refactor imports for recipe implementation and normalised url domain + path for web-js

* Refactor imports for passwordless utils from web-js

* Use latest web-js

* Update size limit

* chore: Merge 0.21 into web-js-integration (#455)

* chore: updated version number

* feat(thirdpartypasswordless): add implementation for thirdpartypasswordless (#372)

* Initial implementation for thirdpartypasswordless

* Added missing prop

* Updated changelog and size checker

* Updated size limits

* refactor(tppwless): Rename signInAndUp to thirdPartySignInAndUp

* fix: reverted unnecessary size inrease

* test(thirdpartypasswordless): Add basic tests

* fix:(thirdpartypasswordless): style context construction

* fix(thirdpartypasswordless): only show provider list on first step of sign in

* test: updated thirdPartySignInAndUp name in test app

* refactor(thirdpartypasswordless): renamed doesXExists to include PasswordlessUser

* feat(thirdpartypasswordless): exporting LinkClicked screen

* fix(thirdpartypasswordless): fix error messages

* test(thirdpartypasswordless): adding override test

* fix(thirdpartypasswordless): fix errors showing up twice

* chore: updated changelog

* refactor(thirdpartypasswordless): Moved HeaderWithProviderList to a separate file

* test(thirdpartypasswordless): add email verification settings to test app

* test(thirdpartypasswordless): Set contactMethod of test app and server to EMAIL_OR_PHONE

* refactor: implementing review feedback on thirdpartypasswordless + finishing touches

* fix(passwordless): revert wrong fix

refactor(thirdpartypasswordless): implemented review feedback

* test(thirdpartypasswordless): reuse tests from subrecipes

* docs(thirdpartypasswordless): added example app

* fix(thirdpartypasswordless): fix optionality of thirdPartyProviderAndEmailOrPhoneFormStyle

* feat: export SignInAndUpCallback feature component

* chore: updated version number

* test(thirdpartypasswordless, passwordless): stability fix + email verification test for tppwless

* docs(thirdpartypasswordless): fix links in example app

* fix: updated fdi version

* test(thirdpartypasswordless): using featureFlags to skip tests if not supported

Co-authored-by: Mihaly Lengyel <[email protected]>
Co-authored-by: Rishabh Poddar <[email protected]>

* updates changelog and fdi json

* adding dev-v0.20.0 tag to this commit to ensure building

* adding dev-v0.20.0 tag to this commit to ensure building

* adds retries to tests

* adding dev-v0.20.0 tag to this commit to ensure building

* updates demo app dependency link

* fix(thirdpartypasswordless): add missing header divider (#406)

Co-authored-by: Mihaly Lengyel <[email protected]>

* updates to changelog

* adding dev-v0.20.0 tag to this commit to ensure building

* chore: Add Github Action to run tests and a PR action to check if tests pass (#407)

* Add workflow helpers and test woekflows for github actions

* Make git config step run before init

* adding dev-v0.20.0 tag to this commit to ensure building

* refactor: Rename query param in SuperTokens branding component to utm_campaign (#408)

* Change query in branding component href to use utm_campaign

* Bump package version to 0.20.1

* Update CHANGELOG

* adding dev-v0.20.1 tag to this commit to ensure building

* ci: export test results and use parallel builds (#405)

* ci: export test results and use parallel builds

* ci: implement review feedback

Co-authored-by: Mihaly Lengyel <[email protected]>
Co-authored-by: Rishabh Poddar <[email protected]>

* fix: form base nextjs bug (#413)

Co-authored-by: Mihaly Lengyel <[email protected]>

* adding dev-v0.20.2 tag to this commit to ensure building

* ci: fix continuation for tag builds (#414)

Co-authored-by: Mihaly Lengyel <[email protected]>

* adding dev-v0.20.2 tag to this commit to ensure building

* Ci fix (#416)

* ci: fix no tests running and markPassed

* adding dev-v0.20.2 tag to this commit to ensure building

* ci: fix no tests running and markPassed

* adding dev-v0.20.2 tag to this commit to ensure building

* ci: fix no tests running and markPassed

* ci: fix no tests running and markPassed

* ci: fix no tests running and markPassed

* adding dev-v0.20.2 tag to this commit to ensure building

* adding dev-v0.20.2 tag to this commit to ensure building

* ci: fix no tests running and markPassed

* adding dev-v0.20.2 tag to this commit to ensure building

* ci: revert unnecessary changes

* ci: fix artifacts

Co-authored-by: Mihaly Lengyel <[email protected]>

* rebuilds and fixes cicd script

* adding dev-v0.20.2 tag to this commit to ensure building

* refactor: use PropsWithChildren whereever we accept children (#419)

* refactor: use PropsWithChildren whereever we accept children

* chore: updated version & changelog

Co-authored-by: Mihaly Lengyel <[email protected]>

* adding dev-v0.20.3 tag to this commit to ensure building

* updates error message

* freezes versions of depdencies

* adding dev-v0.20.4 tag to this commit to ensure building

* docs: Adds vercel example app (#420)

* With emailpassword vercel (#412)

* created the demo app

* created the api folder for the backend

* modified the frontend

* made changes on the api

* modified the api-server

* modified the api-server

* modified frontend and api

* updates on README.md

* update on README.md

* update on REAME.md

* update on REAME.md

* fixed some issues

* modified README.md

* modified README.md

* modified README

* Update examples/with-emailpassword-vercel/README.md

* modiefied the project

* updated the Vercel link

* few fixes

Co-authored-by: Rishabh Poddar <[email protected]>

* runs pretty and updates changelog

* makes getting domain in vercel example app easier

* changes version of auth-react dependency in demo app

* removes unnecessary changes

* changes live link

Co-authored-by: Ekekenta Odionyenfe .C <[email protected]>

* adding dev-v0.20.4 tag to this commit to ensure building

* adds thirdpartypasswordless demo app to cicd

* fixes to cicd for demo app updates

* fixes to cicd for demo app updates

* Update CONTRIBUTING.md (#427)

* chore: Add information about env variables for mailing to passwordless demo apps (#429)

* Add env file and modify README for example/with-passwordless

* Add env file and modify README for example/with-thirdpartypasswordless

* fixes pre commit hook

* removes unnecessary example apps

* feat: Allow users to provide custom cookie and window handlers (#445)

* feat: Allow custom handlers for cookies and window API (#436)

* Add window handling for electron

* Use assign to reload instead of setting href

* Use window utilities instead of getWindowOrThrow

* Update supertokens-website

* Fix window utils

* Update supertokens-website

* Update supertokens-website

* Modify how query params are processed for electron apps

* Use latest supertokens-website

* Use latest supertokens-website

* Update supertokens-website

* Update supertokens-website

* Allow custom cookie handling

* Allow custom cookie handling

* Pass cookie handlers to website sdk init

* Update supertokens-website

* Allow custom window API handling

* Use latest supertokens-website and refactor handler init

* Add default exports for handlers

* Refactor handlers based on changes in supertokens-website

* Use latest supertokens-website

* Rename common to utils

* Remove unused eslint rule

* Update CHANGELOG

* Update package version

* Refactor where handler init is called

* Modify eslint error

* Refactor based on PR reviews

* chore: Add example app for electron using thirdpartypasswordless (#443)

* Add window handling for electron

* Use assign to reload instead of setting href

* Basic setup for electron example app

* Use window utilities instead of getWindowOrThrow

* Update supertokens-website

* Fix window utils

* Update supertokens-website

* Update supertokens-website

* Modifications to example app

* Modify how query params are processed for electron apps

* Use latest supertokens-website

* Update example app

* Use latest supertokens-website

* Update example app

* Update supertokens-website

* Update supertokens-website

* Allow custom cookie handling

* Allow custom cookie handling

* Pass cookie handlers to website sdk init

* Update example app

* Update api server fpr magic links

* Update supertokens-website

* Update example app

* Allow custom window API handling

* Use latest supertokens-website and refactor handler init

* Add default exports for handlers

* Modify example app

* Refactor handlers based on changes in supertokens-website

* Use latest supertokens-website

* Rename common to utils

* Remove unused eslint rule

* Update CHANGELOG

* Update package version

* Edit example app

* Refactor where handler init is called

* Bring app into focus on deep links

* Modify eslint error

* Refactor based on PR reviews

* Update imports to handlers

* Add README and code comments to example app

* Edit electron example app title

* Add check for expired cookies in custom cookie handling

* Update package version

* Update CHANGELOG

* use proper version in electron example app

* Use latest supertokens-website

* Update CHANGELOG

* adding dev-v0.20.5 tag to this commit to ensure building

* feat: update session context on ACCESS_TOKEN_PAYLOAD_UPDATED (#446)

* feat: update session context on ACCESS_TOKEN_PAYLOAD_UPDATED

* chore: increased allowed size for the session recipe

Co-authored-by: Mihaly Lengyel <[email protected]>

* adding dev-v0.21.0 tag to this commit to ensure building

* adds debug log feature (#448)

* adding dev-v0.21.1 tag to this commit to ensure building

* updates size limit

* adding dev-v0.21.1 tag to this commit to ensure building

* feat: react 18 strict mode support (#444)

* feat: add support for react@18 (#437)

Co-authored-by: Mihaly Lengyel <[email protected]>

* docs: update example app deps (#439)

Co-authored-by: Mihaly Lengyel <[email protected]>

* docs: fix example apps (#438)

Co-authored-by: Mihaly Lengyel <[email protected]>

* fix: remove unnecessary import (#449)

Co-authored-by: Mihaly Lengyel <[email protected]>

* test: update tests to react 18 (#440)

* test: update tests to react 18

* test: readd tests for react 16

* test: rework how we link examples to allow multiple versions

* ci: increased timeout limit of testing gh action

* adds --override flag

* refactor: review feedback

Co-authored-by: Mihaly Lengyel <[email protected]>
Co-authored-by: rishabhpoddar <[email protected]>

* chore: update size limits

Co-authored-by: Mihaly Lengyel <[email protected]>
Co-authored-by: rishabhpoddar <[email protected]>

* adding dev-v0.21.2 tag to this commit to ensure building

* fixes dev env for mac and makes e2e tests more reliable for cicd

* adding dev-v0.21.2 tag to this commit to ensure building

* Dependencies fix (#450)

* temp fix

* updates version again

* updates dependencies again

* updates dependencies again

* updates dependencies again

* restores dependency version

* bumps version

* adding dev-v0.21.3 tag to this commit to ensure building

* adds new pr check for pre commit (#451)

* adds new pr check

* updates to pr for debug

* update to pr action

* docs: Adding svelte demo app (#441)

* adds example app with svelte

* added a readme file to the demo app with svelte for better navigation

* pretty

* changed the architecture of the example app with svelte

* undo the version in package lock file

* updated the version

* completed the demo svelte app

* fixes app

* updated the UI of the svelte demo app

Co-authored-by: rtpa25 <[email protected]>

* docs: Adding Supabase example app (#447)

* initial commit

* turns off strict mode

* adds example app

* updates README.md

* uncomments emailVerification

* updates CHANGELOG.md

* code feedback fixs

* updates README.md

* fixs

* adds banner image

* fixs code comment

* fixs

* fixs

* modifies app to use email instead of userId

* copy change

* implements feedback

* comment fixs

* fixs

* fixs

* fixs

* updates to ts

* fixs

* removes incremental flag

* fixs

* fixs

* fix

* fixs

* fixs

* fixs

Co-authored-by: rishabhpoddar <[email protected]>

* chore: fix comments (#454)

* Update size limit

* Use force during init

* Use force in pre commit github action

* Use force in pre commit github action

* Update pre commit action

* Update pre commit action

* Update pre commit github action (#456)

* Remove imports from web-js build

* Refactor based on PR comments

* Changes based on latest web-js-sdk

* Remove userContext from hook dependencies

* Revert starttestapp

* Changes based on latest web-js-sdk

* Update react 16 test app

Co-authored-by: Mihaly Lengyel <[email protected]>
Co-authored-by: Mihály Lengyel <[email protected]>
Co-authored-by: Rishabh Poddar <[email protected]>
Co-authored-by: Rishabh <[email protected]>
Co-authored-by: Ekekenta Odionyenfe .C <[email protected]>
Co-authored-by: rtpa25 <[email protected]>
Co-authored-by: Joel Coutinho <[email protected]>

* Add web js interface supported json

* Update package verison

* Update package lock

Co-authored-by: Mihaly Lengyel <[email protected]>
Co-authored-by: Mihály Lengyel <[email protected]>
Co-authored-by: Rishabh Poddar <[email protected]>
Co-authored-by: Rishabh <[email protected]>
Co-authored-by: Ekekenta Odionyenfe .C <[email protected]>
Co-authored-by: rtpa25 <[email protected]>
Co-authored-by: Joel Coutinho <[email protected]>
  • Loading branch information
8 people authored Jun 1, 2022
1 parent a857128 commit 61bc602
Show file tree
Hide file tree
Showing 293 changed files with 10,410 additions and 9,714 deletions.
7 changes: 6 additions & 1 deletion .circleci/markTesting.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ frontendDriverJson=`cat ../frontendDriverInterfaceSupported.json`
frontendDriverLength=`echo $frontendDriverJson | jq ".versions | length"`
frontendDriverArray=`echo $frontendDriverJson | jq ".versions"`

webInterfaceJson=`cat ../webJsInterfaceSupported.json`
webInterfaceVersion=`echo $webInterfaceJson | jq ".version"`
webInterfaceVersion=`echo $webInterfaceVersion | tr -d '"'`

# get sdk version
version=`cat ../package.json | grep -e '"version":'`
while IFS='"' read -ra ADDR; do
Expand All @@ -23,7 +27,8 @@ responseStatus=`curl -o $FILENAME -w "%{http_code}" -X PUT \
\"password\": \"$SUPERTOKENS_API_KEY\",
\"version\":\"$version\",
\"name\": \"auth-react\",
\"frontendDriverInterfaces\": $frontendDriverArray
\"frontendDriverInterfaces\": $frontendDriverArray,
\"webJsInterface\": \"$webInterfaceVersion\"
}"`
if [ $responseStatus -ne "200" ]
then
Expand Down
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lib/build/* linguist-generated=true
lib/build/**/* linguist-generated=true
4 changes: 3 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Replacing Auth0 credentials in .env.js
run: sed -i 's/AUTH0_EMAIL = "[email protected]"/AUTH0_EMAIL = "${{ secrets.AUTH0_EMAIL }}"/g' test/.env.js && sed -i 's/AUTH0_PASSWORD = "ow93jduDSje00asd"/AUTH0_PASSWORD = "${{ secrets.AUTH0_PASSWORD }}"/g' test/.env.js
- name: Make git use https instead of ssh
run: git config --global url."https://github.com/".insteadOf ssh://[email protected]/
- run: npm run init
Expand All @@ -60,7 +62,7 @@ jobs:
- name: Running loadModules in supertokens-root
run: cd ../supertokens-root && ./loadModules
- name: Installing supertokens-node
run: cd test/server/ && npm i -d && npm i github:${{ github.event.inputs.nodeRepoOwnerName }}/supertokens-node#${{ github.event.inputs.nodeBranchName }}
run: cd test/server/ && npm i -d --force && npm i --force github:${{ github.event.inputs.nodeRepoOwnerName }}/supertokens-node#${{ github.event.inputs.nodeBranchName }}
- name: Setting up supertokens-root test environment
run: cd ../supertokens-root && bash ./utils/setupTestEnv --local
- name: Run tests
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ screenshot.jpeg
/examples/**/yarn.lock
/eslint/node_modules
/test_report/
supertokens-auth-react-*.tgz
supertokens-auth-react-*.tgz
177 changes: 177 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,183 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Adds phone number and password demo app
- Adds an example app with Angular + React

### CI changes

- Now using parallel builds
- Screenshotting failed tests
- Exporting test results

### Changed

- The return type of `user` in the following functions to include information returned by the third party provider
- `signInAndUp` function for ThirdParty recipe
- `thirdPartySignInAndUp` function for the ThirdPartyEmailPassword recipe
- `thirdPartySignInAndUp` function for the ThirdPartyPasswordless recipe

### Added

- All recipe functions now accept an additional parameter `userContext`, learn more about this by visiting the advanced cusotmisations section in the documentation
- All UI components exported by the SDK now accept an additional `userContext` prop, learn more about this by visiting the advanced cusotmisations section in the documentation
- Exports more recipe functions for emailverification recipe to allow them to be called without using the pre-built UI. Newly exported functions: `verifyEmail`, `sendVerificationEmail`
- Exports all emailverification recipe functions from emailpassword, thirdparty, thirdpartyemailpassword and thirdpartypasswordless recipes.
- Exports more recipe functions for emailpassword recipe to allow them to be called without using the pre-built UI. Newly exported functions: `submitNewPassword`, `sendPasswordResetEmail`, `signUp`, `signIn`, `doesEmailExist`.
- Exports more recipe functions for thirdparty recipe to allow them to be called without using the pre-built UI. Newly exported functions: `getAuthorisationURLWithQueryParamsAndSetState`, `signInAndUp`.
- Exports emailpassword and thidparty recipe functions from thirdpartyemailpassword recipe to allow them to be called without using the pre-built UI. Also exports `redirectToThirdPartyLogin` from thirdpartyemailpassword recipe.
- Exports more recipe functions for passwordless recipe to allow them to be called without using the pre-built UI. Newly exported functions: `createCode`, `resendCode`, `consumeCode`, `doesEmailExist`, `doesPhoneNumberExist`
- Exports more recipe functions for thirdpartypasswordless recipe to allow them to be called without using the pre-built UI. Newly exported functions: `redirectToThirdPartyLogin`, `thirdPartySignInAndUp`, `createCode`, `resendCode`, `consumeCode`, `doesPasswordlessUserEmailExist`, `doesPasswordlessUserPhoneNumberExist`
- Changes recipe functions for email verification recipe **(this is breaking change if you use the override feature)**:
- `verifyEmail` -> No longer accepts `token` as a parameter, instead it calls `getEmailVerificationTokenFromURL`
- `getEmailVerificationTokenFromURL` -> NEW FUNCTION
- Changes recipe functions for email password recipe **(this is breaking change if you use the override feature)**:
- `submitNewPassword` -> No longer accepts `token` as a parameter, instead calls `getResetPasswordTokenFromURL`
- `getResetPasswordTokenFromURL` -> NEW FUNCTION
- Changes recipe functions for third party recipe (this is breaking change if you use the override feature):
- `getOAuthState` -> RENAMED TO `getStateAndOtherInfoFromStorage`
- `setOAuthState` -> RENAMED TO `setStateAndOtherInfoToStorage`
- `getOAuthAuthorisationURL` -> RENAMED TO `getAuthorisationURLFromBackend`
- `getAuthorisationURLWithQueryParamsAndSetState` -> NEW FUNCTION
- `generateStateToSendToOAuthProvider` -> NEW FUNCTION
- `verifyAndGetStateOrThrowError` -> NEW FUNCTION
- `getAuthCodeFromURL` -> NEW FUNCTION
- `getAuthErrorFromURL` -> NEW FUNCTION
- `getAuthStateFromURL` -> NEW FUNCTION
- `redirectToThirdPartyLogin` -> REMOVED (use `getAuthorisationURLWithQueryParamsAndSetState` instead). NOTE: If you call this function yourself the SDK will no longer auto-redirect, you will need to redirect to the result url manually.
- Changes recipe funtions for third party email password recipe **(this is breaking change if you use the override feature)**:
- Changes for email password functions explained above
- Changes for third party functions explained above
- `signInAndUp` -> REMOVED, this function has been split into 3 new functions for simplicity (explained below)
- `emailPasswordSignUp` -> NEW FUNCTION
- `emailPasswordSignIn` -> NEW FUNCTION
- `thirdPartySignInAndUp` -> NEW FUNCTION
- Changes recipe functions for passwordless recipe **(this is breaking change if you use the override feature)**:
- `getLinkCodeFromURL` -> NEW FUNCTION
- `getPreAuthSessionIdFromURL` -> NEW FUNCTION
- Changes recipe functions for thirdpartpasswordless recipe : **(this is breaking change if you use the override feature)**:
- Changes for third party functions explained above
- Changes for passwordless recipe explained above
- `clearLoginAttemptInfo` -> RENAMED TO `clearPasswordlessLoginAttemptInfo`
- Session recipe now uses supertokens-web-js internally (previously used supertokens-website)
- All recipes now include a `postAPIHook` configuration parameter that can be used to respond to network actions.
- General error handling for email verification components

### Breaking changes

1. Updates function return types for all recipes to allow for custom API response handling when calling recipe functions manually
2. All recipe functions now return an object which contains a `status` field along with other properties (instead of returning a boolean directly for example), to make function return types more consistent across recipes
3. Updates signatures for functions exported from recipe/index to accept objects instead of params directly, to make function signatures consistent across all recipes
4. Recipe config parameter `disableDefaultImplementation` has been renamed to `disableDefaultUI` to make the name more accurate to the effect the property has. This is applicable only if you are using the SDK with custom UI and disabling the pre-built UI that SuperTokens provides.

### Migration

1. Function return types now include a `fetchResponse` field for any function that makes a network request. If you override functions and return a custom object you will need to update your code to include a `fetchResponse` field that should be a clone of the original response object ([Refer to this page](https://developer.mozilla.org/en-US/docs/Web/API/Response/clone))

For example if your override looks like this:

```ts
import SuperTokens from "supertokens-auth-react";
import EmailPassword from "supertokens-auth-react/recipe/emailpassword";

SuperTokens.init({
appInfo: {
apiDomain: "...",
appName: "...",
websiteDomain: "..."
},
recipeList: [
EmailPassword.init({
override: {
functions: (originalImplementation) => {
return {
...originalImplementation,
signIn: async function (input) {
let response = makeNetworkRequest();
// TODO: some custom logic

return {
status: "OK",
user: {...},
};
},
}
},
}
})
]
});
```

You will need to modify the function like this:

```ts
...
signIn: async function (input) {
let response = makeNetworkRequest();
// TODO: some custom logic

return {
status: "OK",
user: {...},
fetchResponse: response.clone()
};
},
...
```

NOTE: If you use the originalImplementation in your overrides, you can access `fetchResponse` from the returned object

```ts
import SuperTokens from "supertokens-auth-react";
import EmailPassword from "supertokens-auth-react/recipe/emailpassword";

SuperTokens.init({
appInfo: {
apiDomain: "...",
appName: "...",
websiteDomain: "..."
},
recipeList: [
EmailPassword.init({
override: {
functions: (originalImplementation) => {
return {
...originalImplementation,
signIn: async function (input) {
let response = await originalImplementation.signIn(input);
// TODO: some custom logic

return {
status: "OK",
user: {...},
fetchResponse: response.fetchResponse;
};

// OR return the default implementation
// return await originalImplementation.signIn(input)
},
}
},
}
})
]
});
```

2. All recipe functions now return an object instead of returning properties directly. For example:

```ts
async function isEmailVerified(input): Promise<boolean> {...}
```

Now returns

```ts
async function isEmailVerified(input): Promise<{
status: "OK",
isVerified: boolean,
fetchResponse: Response, // Refer to point above
}> {...}
```

## [0.21.3] - 2022-05-14

- Adds an example app with emailpassword + vercel
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/search.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/index.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_authRecipe.default.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_emailpassword.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_passwordless.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_recipeModule.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_session.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_thirdparty.Apple.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_thirdparty.Facebook.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_thirdparty.Github.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_thirdparty.Google.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_thirdparty.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_thirdpartyemailpassword.default.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/classes/recipe_thirdpartypasswordless.default.html

Large diffs are not rendered by default.

Loading

0 comments on commit 61bc602

Please sign in to comment.