Skip to content

Commit bfee886

Browse files
committed
minor refactors
1 parent 8c92a17 commit bfee886

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

services/app/apps/codebattle/lib/codebattle/auth/discord.ex

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,16 @@ defmodule Codebattle.Auth.Discord do
5454
def discord_auth(code, redirect_uri) do
5555
query =
5656
URI.encode_query(%{
57-
"client_id": client_id(),
58-
"client_secret": client_secret(),
59-
"grant_type": "authorization_code",
60-
"code": code,
61-
"redirect_uri": redirect_uri
57+
client_id: client_id(),
58+
client_secret: client_secret(),
59+
grant_type: "authorization_code",
60+
code: code,
61+
redirect_uri: redirect_uri
6262
})
6363

6464
http_client().post!(@discord_token_url <> query,
6565
headers: [
66-
"content-type": "application/x-www-form-urlencoded",
66+
"content-type": "application/x-www-form-urlencoded"
6767
]
6868
)
6969
|> Map.get(:body)
@@ -81,7 +81,7 @@ defmodule Codebattle.Auth.Discord do
8181
http_client().get!("https://discord.com/api/users/@me",
8282
headers: [
8383
"user-agent": "Codebattle",
84-
"authorization": "Bearer #{access_token}",
84+
authorization: "Bearer #{access_token}"
8585
]
8686
)
8787
|> Map.get(:body)

services/app/apps/codebattle/lib/codebattle/auth/github.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ defmodule Codebattle.Auth.Github do
7777
#  https://developer.github.com/v3/#user-agent-required
7878
headers: [
7979
"user-agent": "Codebattle",
80-
"authorization": "token #{access_token}",
80+
authorization: "token #{access_token}"
8181
]
8282
)
8383
|> Map.get(:body)
@@ -90,7 +90,7 @@ defmodule Codebattle.Auth.Github do
9090
#  https://developer.github.com/v3/#user-agent-required
9191
headers: [
9292
"user-agent": "Codebattle",
93-
"authorization": "token #{access_token}",
93+
authorization: "token #{access_token}"
9494
]
9595
)
9696
|> Map.get(:body)

0 commit comments

Comments
 (0)