Y
Y
Yariy2022-03-17 16:19:27
1C-Bitrix
Yariy, 2022-03-17 16:19:27

How to determine that the user is authorized in the public part of the site?

Comrades, how to check in the OnUserAuthorize event that authorization has occurred in the public part? You need to disable the handler for authorization in the admin panel or via the CLI (CI \ CD, when deploying a new version, is authorized on the site to run migrations)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yariy, 2022-03-17
@Yariy

Resolved the issue simply - put a check on the handler:

$request = \Bitrix\Main\Context::getCurrent()->getRequest();

if ($request->isAdminSection() || php_sapi_name() == 'cli') return

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question