Can't access auth methods?

I am trying to use import { getRedirectUriForOneTimeCode, tokenStore } from "wasp/server/auth"; as defined in this gist - https://gist.github.com/infomiho/3c63de7d53aba59d6293bcb59501a029 However, they aren't recognised by Wasp - I am running 0.14.2
Gist
Implementing custom OAuth provider with Wasp 0.14.1+ (Spotify in th...
Implementing custom OAuth provider with Wasp 0.14.1+ (Spotify in this case) - .env.server
5 Replies
kapa.ai
kapa.ai2w ago
Hi @CamBlackwood. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the information provided in the knowledge sources, I don't have enough specific details to directly address your issue with importing getRedirectUriForOneTimeCode and tokenStore from "wasp/server/auth" in Wasp 0.14.2. However, I can provide some relevant information and suggestions: 1. The import path you're using might be outdated or incorrect. In Wasp 0.12 and later versions, there were changes to how auth-related imports are handled. For example, some client-side auth imports now come from 'wasp/client/auth' instead of '@wasp/auth' Discord support thread (https://discord.com/channels/686873244791210014/1215383457392238662). 2. It's possible that the gist you're referencing is outdated or not compatible with the latest version of Wasp. The Wasp framework has undergone significant changes in recent versions, particularly in the auth system. 3. To troubleshoot this issue, you could try the following: - Double-check that you're using the correct import paths for your Wasp version. The documentation for your specific version should provide the correct import statements. - Ensure that you've run wasp start to compile the SDK, which is necessary for the wasp/* packages to be available Discord support thread (https://discord.com/channels/686873244791210014/1215750573278629958). - If the problem persists, you might want to try running wasp clean to delete all .wasp and node_modules folders, then run wasp start again to reinstall everything Discord support thread (https://discord.com/channels/686873244791210014/1215750573278629958). 4. If you're still encountering issues, it would be helpful to check the official Wasp documentation for the most up-to-date information on auth methods and their correct usage in version 0.14.2. 5. Lastly, if the problem continues, you might want to reach out to the Wasp community on their Discord channel or create an issue on their GitHub repository with specific details about your setup and the error messages you're receiving. Remember that Wasp is actively developed, and there might be changes or updates that are not yet reflected in all documentation or community resources. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @CamBlackwood, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
miho
miho6d ago
You have one of the OAuth methods enabled e.g. google or github? It's the prerequisite for that OAuth code to be available. I know it's not ideal, we should provide a better option to say useCustomOAuth or smth like that.
Btw. getRedirectUriForOneTimeCode, tokenStore and shouldn't be necessary for you if you are doing the TikTok bit, the token store is more for implementing full custom OAuth (not just for fetching some OAuth provider data, as I believe is your use case).
CamBlackwood
CamBlackwoodOP6d ago
Ahh I see, thanks @miho I think that’s probably what it is - I don’t have any oauth enabled at all. I’ll do that now 🙂
Filip
Filip4d ago
@miho Do we maybe have an issue for this one?
miho
miho4d ago
GitHub
Enable users to use OAuth helpers without using built-in OAuth meth...
Users need to enable at least one OAuth provider (even if they are not using it) to get Wasp to generate code related to OAuth and install npm deps related to OAuth. Users might have custom OAuth n...
Want results from more Discord servers?
Add your server