W
Wasp2y ago
lazi

[SOLVED]Google Auth error while trying to set-up SaaS GPT Template

I've followed the starting guide but I can't seem to get it to work locally. My best guess is that it's not reading the env variables (yes, renamed). What could I do to fix this? Thank you!
No description
68 Replies
shayne
shayne2y ago
hi there! you will want to add them to your .env.server file. that should be in the root of your project you will want to add lines for GOOGLE_CLIENT_ID=foo and GOOGLE_CLIENT_SECRET=bar
lazi
laziOP2y ago
Thank you! I did that but i couldn't figure it out why was it not reading the actual env file (that's filled) My problem seemed to be (rather stupid) the actual name of the file: i only had env.server not .env.server
shayne
shayne2y ago
ah yes, glad its fixed though!
lazi
laziOP2y ago
Everything seems to be working properly now, just tested registering and gpt generation. Awesome work and thank you again!
shayne
shayne2y ago
great to hear, our pleasure, have fun hacking! 🚀 :wasplang:
lazi
laziOP2y ago
Hmmmm after moving it to fly.io the auth seems to not work anymore 😦 I've set up Google and SendGrid but it doesn't seem to let me log in anymore. I can see the google login screen and "login" but I cannot stay logged in - if i press account again it directs me to login again. Confirmation mails for signup also aparently not working I'm getting an 422 error on google auth
MEE6
MEE62y ago
Wohooo @lazi, you just became a Waspeteer level 1!
matijash
matijash2y ago
hmm have you configured your google app to allow the domain you deployed to?
lazi
laziOP2y ago
I think so, yes
No description
No description
Vinny (@Wasp)
Vinny (@Wasp)2y ago
Did you set a JWT_SECRET env var?
shayne
shayne2y ago
Yeah the main thing @lazi will be double checking your envars for google, sendgrid, etc.
lazi
laziOP2y ago
yep, i checked
lazi
laziOP2y ago
No description
lazi
laziOP2y ago
not manually i think?
shayne
shayne2y ago
what is the URL for your client app? i can try to see if anything pops out
lazi
laziOP2y ago
I made a SaaS App. Buy my stuff.
shayne
shayne2y ago
also what version of Wasp are you using? we had a snag in 0.10.3 i think, 0.10.4 is latest
lazi
laziOP2y ago
is just the basic template with some translated texts
lazi
laziOP2y ago
No description
shayne
shayne2y ago
ah ok you are on latest wasp cli version 0.10.4 thnx hmm give me a sec i was able to login @lazi with google
shayne
shayne2y ago
No description
lazi
laziOP2y ago
hmmm that's very weird, i wonder if it's from just my account because if i log in using google i get redirected to main page and that's about it
shayne
shayne2y ago
yeah i get redirected to the main page too, but click the upper right link
matijash
matijash2y ago
yeah when I login it also seems to be recognized
No description
shayne
shayne2y ago
and go to profile page the default redirect may be setup for the main page after successful login, would depend on your .wasp file (or how @Vinny (@Wasp) set it up)
lazi
laziOP2y ago
did but it directs me to /login :-? and can't access /account but if it works for you i'm pretty sure it's just on me (also i can't access the login or anything from mobile? straight redirect to main)
MEE6
MEE62y ago
Wohooo @lazi, you just became a Waspeteer level 2!
matijash
matijash2y ago
hmm that's weird, maybe try with another google acc?
lazi
laziOP2y ago
yep, it seems to be working on other accounts
matijash
matijash2y ago
ok so it's google's fault 😅
lazi
laziOP2y ago
seems so haha what i still don't get are the email confirmation?
matijash
matijash2y ago
for google login you don't get it I think, only if you log in with an email address
lazi
laziOP2y ago
yeah for that i mean 😄 registering via email directly
matijash
matijash2y ago
got it! I think @miho will have tmrw when he comes in the best ideas on how to debug it I think
lazi
laziOP2y ago
Anything is greatly appreciated 😄 Thank you for the help ❤️
miho
miho2y ago
@lazi could you go to your Fly.io dashboard and check out the backend logs?
miho
miho2y ago
This is how I do it. Please send a screenshot if there are any errors 🙂
lazi
laziOP2y ago
yes, one moment 😄
lazi
laziOP2y ago
No description
lazi
laziOP2y ago
And also, for some weird reason, i can't access the account page (or login,signup, etc.) via mobile :-? I get redirected straight to homepage (Also so very sorry for coming up with so many problems, i'm not really an experienced dev in any way, just tinkering around)
miho
miho2y ago
I see that you received "Forbidden" error when sending your e-mail
lazi
laziOP2y ago
Yes but i don't really understand why
miho
miho2y ago
If you ware using SendGrid, there are some common issues: - sending emails FROM an email address that you didn't verify - sending emails FROM an email address whose domain you didn't verify I had those issues when setting up Sendgrid
lazi
laziOP2y ago
I verified the email but the domain email is not verified with sendgrid
miho
miho2y ago
You are sending the e-mails from the same e-mail you verified?
lazi
laziOP2y ago
no I mean yes but they are on diff domains
lazi
laziOP2y ago
No description
miho
miho2y ago
This is how it looks for me when I go to https://app.sendgrid.com/settings/sender_auth 1. I can only send from [email protected] 2. ... but since I authenticated mail.socialpostgpt.xyz as well, I can send from [email protected]
SendGrid
Delivering your transactional and marketing email through one reliable platform.
No description
miho
miho2y ago
That means, you can only send from [email protected] unless you verify some domain as well 🙂
lazi
laziOP2y ago
No description
lazi
laziOP2y ago
yep, i verified that and should be intended but that's about it do i have to verify the reply domain too?
miho
miho2y ago
I'm not sure about the reply one though 🤔 Do you have any logs in Sendgrid maybe?
lazi
laziOP2y ago
nope don't think so
No description
miho
miho2y ago
So you changed the from field in the email auth settings? And redeployed the app? And you still get the error in your Fly.io backend logs?
lazi
laziOP2y ago
oooh you mean this?
No description
MEE6
MEE62y ago
Wohooo @lazi, you just became a Waspeteer level 3!
lazi
laziOP2y ago
I did not change it in the code oupsie
miho
miho2y ago
Yes sir 😄 That should do it
lazi
laziOP2y ago
redeploying rn awesome, thank you so much! It works, i managed to register an account and log into it via email only now the only "problem" remaining in my set-up is the fact that I can't open the account page on mobile
miho
miho2y ago
@Vinny (@Wasp) this one is for you 🙂 you can reproduce it on desktop with mobile resolution as well
Vinny (@Wasp)
Vinny (@Wasp)2y ago
Ah. Maybe the responsiveness is whack
lazi
laziOP2y ago
What i've noticed in the code is that the mobile disclosure button did not have the same href as the desktop link it simply linked to account, not login if not logged in Checking rn to see if my fix works
Vinny (@Wasp)
Vinny (@Wasp)2y ago
cool. let me know!
lazi
laziOP2y ago
am back I first tried putting the same href but got some unknown error during deploy. What I've found to be working (since Disclosure.Button only takes in strings as href aparently) was do this:
{user ? ( <Disclosure.Button ......... href='/account/ ... > Account </Disclosure.Button> ) : ( .... other disclosure button
seems to be working fine now, switching between account and login
lazi
laziOP2y ago
No description
martinsos
martinsos2y ago
Great work team and @lazi on fixing all this :)! @Vinny (@Wasp) and @miho , are there any action items we should create based on this? Something we need to fix, or can do to avoid similar issues, be it improved docs, DX improvements or smth like that? I am not sure, maybe there is nothing, but wanted to make sure we don't miss the opportunity if there is something.
Vinny (@Wasp)
Vinny (@Wasp)2y ago
yeah I think i can change the mobile design for the menu based on this
martinsos
martinsos2y ago
Sounds good! Feel free to create an issue if that helps tracking it, or if you have your own system of tracking it then ignore this.
Want results from more Discord servers?
Add your server