[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!
68 Replies
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
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
ah yes, glad its fixed though!
Everything seems to be working properly now, just tested registering and gpt generation. Awesome work and thank you again!
great to hear, our pleasure, have fun hacking! 🚀 :wasplang:
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
Wohooo @lazi, you just became a Waspeteer level 1!
hmm have you configured your google app to allow the domain you deployed to?
I think so, yes
Did you set a JWT_SECRET env var?
Yeah the main thing @lazi will be double checking your envars for google, sendgrid, etc.
yep, i checked
not manually i think?
what is the URL for your client app? i can try to see if anything pops out
also what version of Wasp are you using? we had a snag in 0.10.3 i think, 0.10.4 is latest
is just the basic template with some translated texts
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
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
yeah i get redirected to the main page too, but click the upper right link
yeah when I login it also seems to be recognized
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)
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)
Wohooo @lazi, you just became a Waspeteer level 2!
hmm that's weird, maybe try with another google acc?
yep, it seems to be working on other accounts
ok so it's google's fault 😅
seems so haha
what i still don't get are the email confirmation?
for google login you don't get it I think, only if you log in with an email address
yeah for that i mean 😄 registering via email directly
got it! I think @miho will have tmrw when he comes in the best ideas on how to debug it I think
Anything is greatly appreciated 😄
Thank you for the help ❤️
@lazi could you go to your Fly.io dashboard and check out the backend logs?
This is how I do it. Please send a screenshot if there are any errors 🙂
yes, one moment 😄
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)
I see that you received "Forbidden" error when sending your e-mail
Yes but i don't really understand why
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
I verified the email but the domain email is not verified with sendgrid
You are sending the e-mails from the same e-mail you verified?
no
I mean yes but they are on diff domains
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.
yep, i verified that and should be intended but that's about it
do i have to verify the reply domain too?
I'm not sure about the
reply
one though 🤔 Do you have any logs in Sendgrid maybe?nope don't think so
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?oooh you mean this?
Wohooo @lazi, you just became a Waspeteer level 3!
I did not change it in the code oupsie
Yes sir 😄
That should do it
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
@Vinny (@Wasp) this one is for you 🙂 you can reproduce it on desktop with mobile resolution as well
Ah. Maybe the responsiveness is whack
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
cool. let me know!
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 buttonseems to be working fine now, switching between account and login
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.
yeah I think i can change the mobile design for the menu based on this
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.