Skip to content

Commit eeebafd

Browse files
committed
Fix Mix.env/0 unavailable in production release
1 parent 00750fd commit eeebafd

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

config/config.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Config
22

33
config :hexdocs,
4+
scheme: "http",
45
port: "4002",
56
hexpm_url: "http://localhost:4000",
67
hexpm_secret: "2cd6d09334d4b00a2be4d532342b799b",

config/prod.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Config
22

33
config :hexdocs,
4+
scheme: "https",
45
hexpm_impl: Hexdocs.Hexpm.Impl,
56
store_impl: Hexdocs.Store.Impl,
67
cdn_impl: Hexdocs.CDN.Fastly,

lib/hexdocs/plug.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ defmodule Hexdocs.Plug do
102102
end
103103

104104
defp build_oauth_redirect_uri(_conn, organization) do
105-
scheme = if Mix.env() == :prod, do: "https", else: "http"
105+
scheme = Application.get_env(:hexdocs, :scheme)
106106
host = Application.get_env(:hexdocs, :host)
107107
"#{scheme}://#{organization}.#{host}/oauth/callback"
108108
end

0 commit comments

Comments
 (0)