This commit is contained in:
Nicolas Bally 2018-08-16 21:26:05 +02:00
parent bc819872c0
commit 0ddac93147

View File

@ -30,12 +30,15 @@ class Public::ReseauxesController < ApplicationController
sub_domain = request.domain(2).split(".")[0]
@reseaux = Reseaux.where(:sub_domain => sub_domain.to_s).first
if request.domain(1) == "localhost.qz"
redirect_to "http://localhost:3000/public/customers_auths/new?p="+@reseaux.token.to_s
if @reseaux
if request.domain(1) == "localhost.qz"
redirect_to "http://localhost:3000/public/customers_auths/new?p="+@reseaux.token.to_s
else
redirect_to "http://negos.pro/public/customers_auths/new?p="+@reseaux.token.to_s
end
else
render :inline => @reseaux.id.to_s
redirect_to "http://negos.pro"
end