Skip to content

Commit

Permalink
Fix dialyzer errors
Browse files Browse the repository at this point in the history
  • Loading branch information
geekingfrog committed Jun 27, 2024
1 parent 19bc2c2 commit f08f739
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/teiserver/account.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
3 changes: 3 additions & 0 deletions lib/teiserver/account/schemas/user.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver/o_auth.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 1 addition & 0 deletions lib/teiserver/o_auth/schemas/code.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
1 change: 1 addition & 0 deletions lib/teiserver/o_auth/schemas/token.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion lib/teiserver_web/controllers/o_auth/code_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit f08f739

Please sign in to comment.