Skip to content

Commit

Permalink
add everything needed to use discord as social login provider
Browse files Browse the repository at this point in the history
  • Loading branch information
Timo B committed Jun 28, 2018
1 parent 448068e commit 93795b6
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ TWITCH_APP_SECRET=false
GITLAB_APP_ID=false
GITLAB_APP_SECRET=false
GITLAB_BASE_URI=false
DISCORD_APP_ID=false
DISCORD_APP_SECRET=false

# External services such as Gravatar and Draw.IO
DISABLE_EXTERNAL_SERVICES=false
Expand Down
1 change: 1 addition & 0 deletions app/Providers/EventServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class EventServiceProvider extends ServiceProvider
'SocialiteProviders\Okta\OktaExtendSocialite@handle',
'SocialiteProviders\GitLab\GitLabExtendSocialite@handle',
'SocialiteProviders\Twitch\TwitchExtendSocialite@handle',
'SocialiteProviders\Discord\DiscordExtendSocialite@handle',
],
];

Expand Down
2 changes: 1 addition & 1 deletion app/Services/SocialAuthService.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class SocialAuthService
protected $socialite;
protected $socialAccount;

protected $validSocialDrivers = ['google', 'github', 'facebook', 'slack', 'twitter', 'azure', 'okta', 'gitlab', 'twitch'];
protected $validSocialDrivers = ['google', 'github', 'facebook', 'slack', 'twitter', 'azure', 'okta', 'gitlab', 'twitch', 'discord'];

/**
* SocialAuthService constructor.
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"socialiteproviders/microsoft-azure": "^3.0",
"socialiteproviders/okta": "^1.0",
"socialiteproviders/gitlab": "^3.0",
"socialiteproviders/twitch": "^3.0"
"socialiteproviders/twitch": "^3.0",
"socialiteproviders/discord": "^2.0"
},
"require-dev": {
"filp/whoops": "~2.0",
Expand Down
51 changes: 44 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@
'redirect' => env('APP_URL') . '/login/service/twitch/callback',
'name' => 'Twitch',
],
'discord' => [
'client_id' => env('DISCORD_APP_ID'),
'client_secret' => env('DISCORD_APP_SECRET'),
'redirect' => env('APP_URL') . '/login/service/discord/callback',
'name' => 'Discord',
],

'ldap' => [
'server' => env('LDAP_SERVER', false),
Expand Down
1 change: 1 addition & 0 deletions resources/assets/icons/auth/discord.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 93795b6

Please sign in to comment.