feat(thirdparty): add discord provider #1353
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
mostly copied from #1279
Description
This PR adds the Discord OAuth provider in order to support authentication via Discord.
Tests
You need a Discord account and a Discord app. Configure the redirect URL in the "OAuth2" settings of the app, get your client ID and secret and configure with Hanko as usual.
Implementation
I've copied the existing Google provider, however, Discord avatar URLs have to be built based on a returned hash. I implemented this functionality on the Discord provider itself even though it does not rely on any other provider functionality in order to keep the top-level API footprint of the package low.
In addition, I've also setup the Discord icon in the frontend elements and updated the configuration documentation to reflect the new
third_party.providers.discord
config object.Todos
The documentation site still needs to be updated. I didn't update the
docs/
within this repository as it doesn't seem to be the currently active documentation site. If I need to update the docs within this repository, please let me know.