NextAuth redirects to localhost in AWSAmplify - aws-amplify

My Nextjs website is hosted on AWS Amplify and is using NextAuth for authentication.
When i try to signin to my website, the callback redirect takes me to localhost instead of my domain.
I have verified the configuration and environment variables they all look good, the website works fine in my localhost.
What can be the reason for this issue.

I was able to resolve this issue with the below updates in amplify.yml
build:
commands:
- echo "NEXTAUTH_URL=$NEXTAUTH_URL" >> .env
Also make sure :
Your NEXTAUTH_URL has the right protocol as per your hosted website.
Its pointing to the right domain i.e www..com or .com
Reference
https://docs.aws.amazon.com/amplify/latest/userguide/environment-variables.html#access-env-vars

Related

Deploy a nextjs app to vercel and point subdomain from cloudflare

I need to deploy a nextjs app to vercel and I am using cloudflare to manage the dns. I need to point dev.domain.com to vercel deployment. In vercel Project Settings-> Domains I have added the sub domain.
In cloudflare I have added the records as type: cname . name: dev content: cname.vercel-dns.com . In vercel it is showing valid configuration. When I tried to access the subdomain it says site cant be reached with error code as DNS_PROBE_FINISHED_NXDOMAIN
you need to add A record for your subdomain pointing to vercel ip.
Type: A
Name: dev
Content: vercel ip
make sure to switch off proxy status until vercel verifies your site

Firebase Hosting hosted website with custom domain not loading with www prefix

I own a domain through GoDaddy with the .app extension (call it mydomain.app). I have a site hosted on Firebase Hosting for this domain and it works fine. However, the website only loads through https://mydomain.app and not https://www.mydomain.app. I have the DNS properly configured according to GoDaddy tech support and wonder if I'm supposed to explicitly add www.mydomain.app in Firebase hosting in addition to mydomain.app? Seems redundant. Or is this not necessary and I have a configuration problem on my hands?
Go to GoDaddy, where you added your A record to point to Firebase the first time.
Since it's working, that means you configured it to use
# ==> your FirebaseAppUrl.
Under it, now, add also another A record, to configure your www.mydomain.com,
by adding www A record, to point to the same place.
www ==> your FirebaseAppUrl.
Keep both records of course in GoDaddy.

Firebase hosting not connecting to custom domain

I have a working blahblah.firebaseapp.com default domain working correctly. No problems there. My website was on another provider so I went through the process to connect it to firebase hosting. Everything went fine and the domain status in Firebase Hosting console shows connected for my blahblah.com and www.blahblah.com domains. My problem is that when I navigate to blahblah.com, I get a page that says
I can't find anyone with quite the same issue on Stackoverflow or any other site. There was one that was fixed by opening in a different browser (cached site issue), but this isn't my problem. I have double checked the DNS settings from my provider. Everything checks out. It's been close to 20 hours since I have completed the verification and the status shows connected in firebase hosting. I even re-deployed my site to firebase to see if that would reset something. Didn't help.
So now what should I do? Any ideas?
Assuming you initialized your project with default values, your public directory is what get's served. So, edit or add the index.html file in your public folder then firebase deploy. You should now be able to see your custom HTML.
I had also the same issue, experimented a bit and found the solution.
Case 1- You want your website to be served at subdomain.domain.tld as will as on domain.tld, but added only subdomain.domain.tld as custom domain on firebase hosting dashboard.
In this case the address domain.tld will throw an error.
To get rid of this error add another custom domain in your firebase
hosting dashboard as domain.tld
Case- 2- You want your website to be served over domain.tld but also accessible through subdomain.domain.tld
Add both the domains in custom domain field.
Edit subdomain.domain.tld to redirect at domain.tld.
Case- 3- You want your website to be served over subdomain.domain.tld but also accessible through domain.tld
Add both the domains in custom domain field.
Edit domain.tld to redirect at subdomain.domain.tld.

www subdomain points to a completely different project

I have the weirdest problem. I deployed my app to heroku and registered a domain name lets say: xyz.example . I tried to move to this URL and my project was there and working fine, then I tried to move to www.xyz.example and I get a completely different project that exist in my computer but have nothing to do with heroku and never have been deployed to there! Its a static website that has been uploaded to another domain using filezila a while ago. My domain provider is Domain.com. I tried to look there for answer in my domains list but nothing has changed and it's all looks fine. What can it be?
To connect your heroku hosting to your domain name,
you have to open your domain name account and in the DNS Management page add in the cname the host: www and in the point to: your heroku url And in the heroku page in the settings add three domains:
*.xyz.example
xyz.example
www.xyz.example
This should work :) Check this video https://www.youtube.com/watch?v=kKGSGT7mSnQ&feature=youtu.be

Wordpress Zapier and Webhooks with Cloud9

I am trying to test out webhooks integration with wordpress using the cloud9 ide as a proof of concept before moving on to an actual wordpress hosting.
I created the wordpress site in cloud9 and it works fine, but when I try to connect to my Zapier account to my wordpress account (on cloud9), I always get an error.
The error is
"We hit an error adding your new account
authorization failed: ResponseError()"
My first thought is that there are CORs problems, but I don't know if there is any way to debug the login attempt from Zapier.
Has anyone successfully managed to connect Zapier to a wordpress site hosted on cloud9? If so, was there any specific CORS settings necessary to make that work?
Thanks
The reason that this wouldn't work is because the seemingly global URL I use to access my cloud9 wordpress site is only available within the browser I was logged into cloud9 with, from other browsers/machines the cloud9 login page was blocking access, therefore Zapier could not access it.
The alternative seems to be to host wordpress somewhere globally accessible or host locally and forward port 80/443 on your router so that Zapier can access your local account.

Resources