Skip to content

Commit

Permalink
Fix Google redirect in production
Browse files Browse the repository at this point in the history
  • Loading branch information
xendk committed Jan 2, 2025
1 parent 2a75022 commit d93388f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/controllers/session_controller.cr
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ class SessionController < ApplicationController
end

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

0 comments on commit d93388f

Please sign in to comment.