Skip to content

Commit d93388f

Browse files
committed
Fix Google redirect in production
1 parent 2a75022 commit d93388f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/controllers/session_controller.cr

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ class SessionController < ApplicationController
5959
end
6060

6161
private def multi_auth
62-
MultiAuth.make("google", "#{Amber::Server.instance.host_url.gsub(/0.0.0.0/, "localhost")}/signin/callback")
62+
# Amber doesn't know that it's behind a Traefik with SSL in
63+
# production, so it can't figure out the real hostname and schema.
64+
base = Amber.env.production? ? "https://combine.reload.dk" : Amber::Server.instance.host_url.gsub(/0.0.0.0/, "localhost")
65+
MultiAuth.make("google", "#{base}/signin/callback")
6366
end
6467
end

0 commit comments

Comments
 (0)