Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added discord auth provider #7

Merged
merged 9 commits into from
Nov 11, 2023
Merged

feat: added discord auth provider #7

merged 9 commits into from
Nov 11, 2023

Conversation

justserdar
Copy link
Contributor

@justserdar justserdar commented Nov 9, 2023

Created a Discord provider based on the spotify provider.

The Discord provider is useful when you want to connect your Nuxt 3 project with your Discord Community.
Have information about your users displayed in your codebase or just simply create cool widgets or things visitors or users can see.

Screenshot_2023_11_09-1

The auth flow requires a HTTPS redirect uri, I have it working using NGROk locally.
Discord provides a developer section where you can setup your applications and get your token information.
The user will have to setup their oauth settings at Discord like any other platform.

I found a challenge when introducing the redirect_uri as a configurable variable in the config because it needs to redirect back to 'https://your-domain.com + /auth/discord'
Edit: Improved it with the domain variable

@atinux
Copy link
Owner

atinux commented Nov 9, 2023

Thank you for the PR @justserdar

You don't need to use ngrok actually, you can simply have HTTPS with Nuxt in development with npx nuxi dev --https

We should not have a variable for the domain IMO like the others Oauth providers we have.

@justserdar
Copy link
Contributor Author

Hey!

I removed the domain usage and went for the existing request path route as per the other oauth providers.
Thank you about the tip with --https!

@atinux atinux merged commit ba78a8b into atinux:main Nov 11, 2023
3 checks passed
samulefevre pushed a commit to samulefevre/nuxt-auth-utils that referenced this pull request Nov 11, 2023
* feat: discord auth provider

* Update discord.get.ts

Typo
Github -> Discord

* fix: Update redirectUrl to include server route

* refactor: cleanup discord provider

* fix: Added discord env vars in example env

* feat: Module addition of Discord vars

* [autofix.ci] apply automated fixes

* refactor: removed domain env usage

* chore: update

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Sébastien Chopin <[email protected]>
atinux added a commit that referenced this pull request Nov 13, 2023
* add oauth battle.net

* add battle.net to env.example

* fix: rm emailRequired and if cn to better place

* feat: added discord auth provider (#7)

* feat: discord auth provider

* Update discord.get.ts

Typo
Github -> Discord

* fix: Update redirectUrl to include server route

* refactor: cleanup discord provider

* fix: Added discord env vars in example env

* feat: Module addition of Discord vars

* [autofix.ci] apply automated fixes

* refactor: removed domain env usage

* chore: update

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Sébastien Chopin <[email protected]>

* chore: update

---------

Co-authored-by: h+ <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Sébastien Chopin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants