Skip to content

Commit b0a8ece

Browse files
authored
Update elixir_auth_google.ex
tested in prod. its working.
1 parent 80e9477 commit b0a8ece

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/elixir_auth_google.ex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ defmodule ElixirAuthGoogle do
2525
@doc """
2626
`get_baseurl_from_conn/1` derives the base URL from the conn struct
2727
"""
28-
@spec get_baseurl_from_conn(conn) :: String.t()
28+
@spec get_baseurl_from_conn(conn) :: String.t()
2929
def get_baseurl_from_conn(%{host: h, port: p, scheme: s}) do
30-
if p != p do
31-
"#{Atom.to_string(s)}://#{h}"
32-
else
33-
"#{Atom.to_string(s)}://#{h}:#{p}"
30+
cond do
31+
p == 443 -> "#{Atom.to_string(s)}://#{h}"
32+
p == 80 -> "#{Atom.to_string(s)}://#{h}"
33+
true -> "#{Atom.to_string(s)}://#{h}:#{p}"
3434
end
3535
end
3636

0 commit comments

Comments
 (0)