mirror of
https://github.com/mgerb/classic-wow-forums
synced 2026-01-11 09:32:51 +00:00
server - support for admin/mod users
This commit is contained in:
@@ -7,6 +7,19 @@ defmodule MyAppWeb.UserController do
|
||||
|
||||
# https://us.battle.net/oauth/authorize?redirect_uri=https://localhost/api/battlenet/authorize&scope=wow.profile&client_id=vxqv32fddxsy6cmk6259amtymbuzmfrq&response_type=code
|
||||
|
||||
# this is for auth with username/password - currently only for admin
|
||||
def login(conn, params) do
|
||||
{output, status} = params
|
||||
|> Data.User.login
|
||||
|> Auth.Token.add_token_and_map_claims
|
||||
|> Response.put_resp
|
||||
|
||||
conn
|
||||
|> put_status(status)
|
||||
|> Response.json(output)
|
||||
end
|
||||
|
||||
# this is for authorization with battlenet
|
||||
@spec authorize(map, map) :: any
|
||||
def authorize(conn, %{"code" => code}) when not is_nil(code) do
|
||||
|
||||
|
||||
Reference in New Issue
Block a user