Incorrect server redirection uri fix
This commit is contained in:
parent
387ac72d1b
commit
f05daabe0d
@ -12,6 +12,7 @@ REACT_APP_DISCORD_INVITE=https://discord.gg/ajsdlkfjaskldjf
|
||||
REACT_APP_DISCORD_OAUTH=https://discord.com/api/oauth2/authorize?client_id=CLIENT_ID&redirect_uri=FRONTEND_REDIRECT_PORT_FROM_BELOW&response_type=code&scope=identify
|
||||
|
||||
CLIENT_REDIRECT_AFTER_OAUTH=http://127.0.0.1:3000/auth-successful
|
||||
SERVER_REDIRECT_URI=http://127.0.0.1:3000/api/oauth/redirect
|
||||
|
||||
DISCORD_CLIENT_ID=
|
||||
DISCORD_CLIENT_SECRET=
|
||||
|
@ -8,7 +8,9 @@ config :chessh, Web,
|
||||
discord_client_secret: System.get_env("DISCORD_CLIENT_SECRET"),
|
||||
discord_user_agent: System.get_env("DISCORD_USER_AGENT"),
|
||||
client_redirect_after_successful_sign_in:
|
||||
System.get_env("CLIENT_REDIRECT_AFTER_OAUTH", "http://127.0.0.1:3000/oauth-successfule"),
|
||||
System.get_env("CLIENT_REDIRECT_AFTER_OAUTH", "http://127.0.0.1:3000/auth-successful"),
|
||||
server_redirect_uri:
|
||||
System.get_env("SERVER_REDIRECT_URI", "http://127.0.0.1:3000/api/oauth/redirect"),
|
||||
port: String.to_integer(System.get_env("WEB_PORT", "8080"))
|
||||
|
||||
config :joken,
|
||||
|
@ -32,7 +32,7 @@ defmodule Chessh.Web.Endpoint do
|
||||
case :httpc.request(
|
||||
:post,
|
||||
{String.to_charlist(discord_login_url), [], 'application/x-www-form-urlencoded',
|
||||
'scope=#{discord_scope}&client_id=#{client_id}&client_secret=#{client_secret}&code=#{req_token}&grant_type=authorization_code&redirect_uri=#{redirect_uri}'},
|
||||
'scope=#{discord_scope}&client_id=#{client_id}&client_secret=#{client_secret}&code=#{req_token}&grant_type=authorization_code&redirect_uri=http://127.0.0.1:3000/api/oauth/redirect'},
|
||||
[],
|
||||
[]
|
||||
) do
|
||||
@ -214,7 +214,7 @@ defmodule Chessh.Web.Endpoint do
|
||||
:discord_client_secret,
|
||||
:discord_user_api_url,
|
||||
:discord_user_agent,
|
||||
:client_redirect_after_successful_sign_in
|
||||
:server_redirect_uri
|
||||
],
|
||||
fn key -> Application.get_env(:chessh, Web)[key] end
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user