Dev: Set magic link as header when JSON request in development

This commit is contained in:
Fernando Olivares
2025-12-04 14:11:43 -06:00
committed by Stanko K.R.
parent 7644bb7411
commit ab0f7a3ea5
+4 -1
View File
@@ -23,7 +23,10 @@ class SessionsController < ApplicationController
respond_to do |format|
format.html { redirect_to_session_magic_link magic_link }
format.json { head :created }
format.json do
response.set_header("X-Magic-Link-Code", magic_link&.code) if Rails.env.development? && magic_link
head :created
end
end
end