File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
services/app/apps/codebattle/lib/codebattle/auth Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -54,16 +54,16 @@ defmodule Codebattle.Auth.Discord do
54
54
def discord_auth ( code , redirect_uri ) do
55
55
query =
56
56
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
62
62
} )
63
63
64
64
http_client ( ) . post! ( @ discord_token_url <> query ,
65
65
headers: [
66
- "content-type": "application/x-www-form-urlencoded" ,
66
+ "content-type": "application/x-www-form-urlencoded"
67
67
]
68
68
)
69
69
|> Map . get ( :body )
@@ -81,7 +81,7 @@ defmodule Codebattle.Auth.Discord do
81
81
http_client ( ) . get! ( "https://discord.com/api/users/@me" ,
82
82
headers: [
83
83
"user-agent": "Codebattle" ,
84
- " authorization" : "Bearer #{ access_token } " ,
84
+ authorization: "Bearer #{ access_token } "
85
85
]
86
86
)
87
87
|> Map . get ( :body )
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ defmodule Codebattle.Auth.Github do
77
77
# https://developer.github.com/v3/#user-agent-required
78
78
headers: [
79
79
"user-agent": "Codebattle" ,
80
- " authorization" : "token #{ access_token } " ,
80
+ authorization: "token #{ access_token } "
81
81
]
82
82
)
83
83
|> Map . get ( :body )
@@ -90,7 +90,7 @@ defmodule Codebattle.Auth.Github do
90
90
# https://developer.github.com/v3/#user-agent-required
91
91
headers: [
92
92
"user-agent": "Codebattle" ,
93
- " authorization" : "token #{ access_token } " ,
93
+ authorization: "token #{ access_token } "
94
94
]
95
95
)
96
96
|> Map . get ( :body )
You can’t perform that action at this time.
0 commit comments