M
M
mrFlyer2017-08-03 11:01:52
Laravel
mrFlyer, 2017-08-03 11:01:52

VerifyCsrfToken and two domains?

Good afternoon.
I have 2 domains on one project (not subdomains).
.env looks like this:

# стандартное определение домена по умолчанию
APP_URL=http://domain1.com
APP_HOST=domain1.com

# Добавляю определение второго домена
DM2_URL=http://domain2.com
DM2_HOST=domain2.com

According to my understanding, I now have to check App\Http\Middleware\VerifyCsrfToken in the constructor from which domain the request is coming from, and if from the second, replace APP_HOST and APP_URL with DM2_HOST and DM2_URL.
And it is also probably necessary to do this during the generation of the token itself? But I understand how to do it right.
Thanks in advance for the tip!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question