diff --git a/lib/teiserver/account.ex b/lib/teiserver/account.ex index 9bffb16df..6e85d5a34 100644 --- a/lib/teiserver/account.ex +++ b/lib/teiserver/account.ex @@ -9,6 +9,8 @@ defmodule Teiserver.Account do alias Teiserver.Account.UserLib + @type t :: UserLib.t() + @spec icon :: String.t() def icon, do: "fa-solid fa-user-alt" diff --git a/lib/teiserver/account/schemas/user.ex b/lib/teiserver/account/schemas/user.ex index 2792f1274..daa7ffa84 100644 --- a/lib/teiserver/account/schemas/user.ex +++ b/lib/teiserver/account/schemas/user.ex @@ -5,6 +5,9 @@ defmodule Teiserver.Account.User do alias Argon2 + # TODO: this is where a user should be defined. This is only a placeholder for now + @type t :: term() + schema "account_users" do field :name, :string field :email, :string diff --git a/lib/teiserver/o_auth.ex b/lib/teiserver/o_auth.ex index 478b6f911..d54666d49 100644 --- a/lib/teiserver/o_auth.ex +++ b/lib/teiserver/o_auth.ex @@ -319,7 +319,7 @@ defmodule Teiserver.OAuth do String.t(), String.t() ) :: - {:ok, Secret.t()} | {:error, term()} + {:ok, Credential.t()} | {:error, term()} def create_credentials(%Application{} = app, autohost, client_id, secret), do: create_credentials(app.id, autohost, client_id, secret) diff --git a/lib/teiserver/o_auth/schemas/code.ex b/lib/teiserver/o_auth/schemas/code.ex index 0eb5d14bb..38f37b68f 100644 --- a/lib/teiserver/o_auth/schemas/code.ex +++ b/lib/teiserver/o_auth/schemas/code.ex @@ -3,6 +3,7 @@ defmodule Teiserver.OAuth.Code do use TeiserverWeb, :schema alias Teiserver.OAuth + alias Teiserver.Account.User @type t :: %__MODULE__{ value: String.t(), diff --git a/lib/teiserver/o_auth/schemas/token.ex b/lib/teiserver/o_auth/schemas/token.ex index 87accd33b..737d8085c 100644 --- a/lib/teiserver/o_auth/schemas/token.ex +++ b/lib/teiserver/o_auth/schemas/token.ex @@ -3,6 +3,7 @@ defmodule Teiserver.OAuth.Token do use TeiserverWeb, :schema alias Teiserver.OAuth + alias Teiserver.Account.User @type t :: %__MODULE__{ value: String.t(), diff --git a/lib/teiserver_web/controllers/o_auth/code_controller.ex b/lib/teiserver_web/controllers/o_auth/code_controller.ex index 30dd436dc..a6728f284 100644 --- a/lib/teiserver_web/controllers/o_auth/code_controller.ex +++ b/lib/teiserver_web/controllers/o_auth/code_controller.ex @@ -3,7 +3,7 @@ defmodule TeiserverWeb.OAuth.CodeController do alias Teiserver.OAuth # https://www.rfc-editor.org/rfc/rfc6749.html#section-4.1.3 - @spec token(Conn.t(), %{}) :: Conn.t() + @spec token(Plug.Conn.t(), %{}) :: Plug.Conn.t() def token(conn, %{"grant_type" => "authorization_code"} = params) do case Enum.find(