diff options
author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-09-14 09:38:16 -0600 |
---|---|---|
committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-09-14 09:38:16 -0600 |
commit | 0d4b60520efad059fc387626e1b7e4edf141d7e1 (patch) | |
tree | 06f1c05d1959a6b206bfd77319e775f27c4a3b1e /lib/chessh/web/web.ex | |
parent | 87bd117289f6824a61fd30d7633d07d305435924 (diff) | |
download | chessh-0d4b60520efad059fc387626e1b7e4edf141d7e1.tar.gz chessh-0d4b60520efad059fc387626e1b7e4edf141d7e1.zip |
update dependencies and fix discriminator matching on username
Diffstat (limited to 'lib/chessh/web/web.ex')
-rw-r--r-- | lib/chessh/web/web.ex | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/chessh/web/web.ex b/lib/chessh/web/web.ex index 5835ff2..d5e2be5 100644 --- a/lib/chessh/web/web.ex +++ b/lib/chessh/web/web.ex @@ -26,13 +26,6 @@ defmodule Chessh.Web.Endpoint do redirect_uri ] = get_discord_configs() - Logger.warn( - inspect( - {String.to_charlist(discord_login_url), [], ~c"application/x-www-form-urlencoded", - ~c"scope=#{discord_scope}&client_id=#{client_id}&client_secret=#{client_secret}&code=#{req_token}&grant_type=authorization_code&redirect_uri=#{redirect_uri}"} - ) - ) - resp = case conn.params do %{"code" => req_token} -> @@ -473,7 +466,7 @@ defmodule Chessh.Web.Endpoint do [] ) do {:ok, {{_, 200, ~c"OK"}, _, user_details}} -> - %{"username" => username, "discriminator" => discriminator, "id" => discord_id} = + %{"username" => username, "id" => discord_id} = Jason.decode!(String.Chars.to_string(user_details)) case Repo.get_by(Player, discord_id: discord_id) do @@ -481,8 +474,7 @@ defmodule Chessh.Web.Endpoint do player -> player end |> Player.discord_changeset(%{ - username: username <> "#" <> discriminator, - discord_id: discord_id + username: username }) |> Repo.insert_or_update() |