Commit 16ce51dd authored by Mikko Ahlroth's avatar Mikko Ahlroth

OAuth refactor beginnings

parent 1b5ba4dc
Pipeline #22148456 passed with stage
in 4 minutes and 17 seconds
......@@ -44,6 +44,8 @@ config :code_stats, CodeStats.Repo,
config :appsignal, :config, active: true
config :oauth2, debug: true
# To avoid conflicts with workspaces
# dev.secret.exs is not versioned, like prod.secret.exs
import_config "dev.secret.exs"
defmodule CodeStats.User.AuthCredentials do
use Ecto.Schema
schema "auth_credentials" do
field(:from, :string)
end
end
......@@ -67,7 +67,9 @@ defmodule CodeStatsWeb.AuthUtils do
Returns nil if user was not found.
"""
@spec get_user(String.t(), boolean) :: %User{} | nil
@type get_user_opt :: {:case_insensitive, boolean} | {:from, String.t()}
@type get_user_opts :: [get_user_opt]
@spec get_user(String.t(), get_user_opts) :: %User{} | nil
def get_user(username, opts \\ []) do
query =
case Keyword.get(opts, :case_insensitive, false) do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment