Hi folks, I'm having trouble using axios in a quasar (vue3) vite project with supertokens alongside ...
j

jmark

over 2 years ago
Hi folks, I'm having trouble using axios in a quasar (vue3) vite project with supertokens alongside hasura, as far as I can tell the interceptor needed for axios only exists in the react-native supertokens package as the one in supertokens-web-js is deprecated and doesn't seem to let me use the interceptor. When I import the react-native supertokens package in my project the build fails, I've tried it in both vite and webpack with similar results. The vite error is:
7:52:14 PM [vite] error while updating dependencies:
Error: Build failed with 2 errors:
node_modules/react-native/Libraries/Utilities/PolyfillFunctions.js:28:31: ERROR: Expected "(" but found "<"
node_modules/react-native/index.js:14:7: ERROR: Unexpected "typeof"
    at failureErrorWithLog (C:\Users\Josh\Documents\api-testing\ui-selfhosted\node_modules\esbuild\lib\main.js:1621:15)
    at C:\Users\Josh\Documents\api-testing\ui-selfhosted\node_modules\esbuild\lib\main.js:1263:28
    at runOnEndCallbacks (C:\Users\Josh\Documents\api-testing\ui-selfhosted\node_modules\esbuild\lib\main.js:1043:63)
    at buildResponseToResult (C:\Users\Josh\Documents\api-testing\ui-selfhosted\node_modules\esbuild\lib\main.js:1261:7)
    at C:\Users\Josh\Documents\api-testing\ui-selfhosted\node_modules\esbuild\lib\main.js:1374:14
    at C:\Users\Josh\Documents\api-testing\ui-selfhosted\node_modules\esbuild\lib\main.js:675:9
    at handleIncomingPacket (C:\Users\Josh\Documents\api-testing\ui-selfhosted\node_modules\esbuild\lib\main.js:772:9)
    at Socket.readFromStdout (C:\Users\Josh\Documents\api-testing\ui-selfhosted\node_modules\esbuild\lib\main.js:641:7)
    at Socket.emit (node:events:527:28)
    at addChunk (node:internal/streams/readable:315:12)
Vite Error, /node_modules/.q-cache/vite/spa/deps/supertokens-react-native.js?v=c3ec6ab7 optimized info should be defined
Any ideas on how I can get this working with vite, I've had no luck trying the various solutions I've found on google so far.
Hello everyone! I have a general question about SuperTokens, I like the idea of using it as an authe...
d

dan6erbond

over 3 years ago
Hello everyone! I have a general question about SuperTokens, I like the idea of using it as an authentication server for my fairly large architecture with multiple services, but I'll also need the flexibility which I'm not sure it has. I'm wondering if those will be easy features to add or not, so in your experience, is SuperTokens easy to integrate with? https://supertokens.com/docs/thirdpartyemailpassword/advanced-customizations/apis-override/usage One example I have is that I want to expose some LDAP functions using LDAP.js and allow access to SuperTokens users, I will also use the new UserRoles recipe to get the LDAP functionality SuperTokens provides: https://supertokens.com/docs/nodejs/modules/recipe_userroles.html Furthermore, it would be great, if I could have more direct control over SuperTokens, for instance I want to create a certain user type with preset fields if they're coming from a specific tool, which means I could either override SuperTokens hooks, or what I would prefer to do is call a custom API method like
POST /auth/<user-type>
and then call a function from SuperTokens SDK to create that user: https://supertokens.com/docs/nodejs/modules/recipe_thirdpartyemailpassword.html#emailPasswordSignUp-1 Is this a good way to go about it? Also, how much data is recommended to be stored with the UserMetadata recipe? Should it only be for very simple structs or can I use SuperTokens to handle business data such as a paid subscription or personal data? https://supertokens.com/docs/thirdpartyemailpassword/common-customizations/usermetadata/about