I don't understand why this function is needed ...
Code:
@doc """
Same as `github_auth/1` except it adds the state String returned from GitHub.
"""
def github_auth(code, state) do
case github_auth(code) do
{:ok, user} ->
{:ok, Map.put(user, "state", state)}
error ->
error
end
end
Tests:
test "Test github auth with state" do
setup_test_environment_variables()
assert ElixirAuthGithub.github_auth("12345", "hello") ==
{:ok, %{"access_token" => "12345", "login" => "test_user", "state" => "hello"}}
end
test "test github auth failure with state" do
setup_test_environment_variables()
assert ElixirAuthGithub.github_auth("1234", "hello") ==
{:error, %{"error" => "error"}}
end
I don't understand why this function is required.
And since it is not used by any of our projects.
I'm removing it. ✂️
The
github_auth/2
function is not used anywhere in @dwyl GitHub. https://github.com/search?q=org%3Adwyl+github_auth&type=CodeI don't understand why this function is needed ...
Code:
Tests:
I don't understand why this function is required. And since it is not used by any of our projects. I'm removing it. ✂️