Back

[SOLVED] Integrating Discord Oauth issues

  • 0
  • Accounts
  • Web
Binyamin
4 Jul, 2023, 01:26

Go to your project overview page

TL;DR
Summary: The user was having issues integrating Discord Oauth on a website. Safari was not liking the domain and cookies were blocked. The solution suggested was to add a custom domain in Appwrite, set Vercel app with the same domain, and check if cookies were blocked in Safari's privacy settings. It was also suggested to replace `window.location` with absolute URLs. The issue persisted on both Safari and Safari on the user's phone. The final suggestion was to add another platform and include the URL to the Vercel project. Solution: 1. Add a custom domain in Appwrite and set Vercel app with
Binyamin
4 Jul, 2023, 01:27

Then add another platform. In this platform put the url to your vercel project

larkx
4 Jul, 2023, 01:29

Thank you

larkx
4 Jul, 2023, 01:29

Okay, so after checks

larkx
4 Jul, 2023, 01:29

Same issue happens on my phone (Safari)

larkx
4 Jul, 2023, 01:29

So it's clearly Safari doing a weird Safari thing

Binyamin
4 Jul, 2023, 01:30

Maybe it's because of the window.location try to replace it with absolute URLs

TypeScript
           const response = await account.createOAuth2Session(
                'discord',
                'https://yourwebsite.com',
                `https://yourwebsite.com/failure`,
            );
larkx
4 Jul, 2023, 01:31

The session is being created, I can see it on the dashboard for appwrite

Binyamin
4 Jul, 2023, 01:34

Yes, but it's seems like Safari won't let the 3rd domain cookies to be create

larkx
4 Jul, 2023, 01:34

Oh

Binyamin
4 Jul, 2023, 01:34

Maybe your cookies are blocked in Safari > Settings > Privacy

Binyamin
4 Jul, 2023, 01:34

?

Binyamin
4 Jul, 2023, 01:35

Maybe in Safari you'll need to add a custom domain in your Appwrite And set your Vercel app with the same domain (sub-domain)

Check this: https://appwrite.io/docs/custom-domains

larkx
4 Jul, 2023, 01:35

I'll try that

larkx
4 Jul, 2023, 01:35

Nope

larkx
4 Jul, 2023, 01:38

So would a setup like this work? Appwrite: api.chatx.example.com Vercel: chatx.example.com

Binyamin
4 Jul, 2023, 01:38

Yes

larkx
4 Jul, 2023, 01:38

Ok

larkx
4 Jul, 2023, 01:49

You're a life saver @Binyamin, if I could give you a hug right now I would

larkx
4 Jul, 2023, 01:50

All sorted

larkx
4 Jul, 2023, 01:50

Safari likes my domain now

Binyamin
4 Jul, 2023, 01:50

<a:ablobattention:492776678742032395>

Binyamin
4 Jul, 2023, 01:50

Great

larkx
4 Jul, 2023, 01:50

And now I sleep <a:aPES_Sleep:513527329738194954>

larkx
4 Jul, 2023, 01:51

[SOLVED] Integrating Discord Oauth issues

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more