|
@@ -72,15 +72,8 @@ class FreshRSS extends Minz_FrontController {
|
|
|
private static function initAuth(): void {
|
|
private static function initAuth(): void {
|
|
|
FreshRSS_Auth::init();
|
|
FreshRSS_Auth::init();
|
|
|
if (Minz_Request::isPost()) {
|
|
if (Minz_Request::isPost()) {
|
|
|
- if (!FreshRSS_Context::hasSystemConf() || !(FreshRSS_Auth::isCsrfOk() ||
|
|
|
|
|
- (Minz_Request::controllerName() === 'auth' && Minz_Request::actionName() === 'login') ||
|
|
|
|
|
- (Minz_Request::controllerName() === 'user' && Minz_Request::actionName() === 'create' && !FreshRSS_Auth::hasAccess('admin')) ||
|
|
|
|
|
- (Minz_Request::controllerName() === 'feed' && Minz_Request::actionName() === 'actualize' &&
|
|
|
|
|
- FreshRSS_Auth::allowAnonymousRefresh()) ||
|
|
|
|
|
- (Minz_Request::controllerName() === 'javascript' && Minz_Request::actionName() === 'actualize' &&
|
|
|
|
|
- FreshRSS_Auth::allowAnonymous())
|
|
|
|
|
- )) {
|
|
|
|
|
- // Token-based protection against XSRF attacks, except for the login or self-create user forms
|
|
|
|
|
|
|
+ if (!FreshRSS_Context::hasSystemConf() || !FreshRSS_Auth::isCsrfOk()) {
|
|
|
|
|
+ // Token-based protection against CSRF attacks
|
|
|
self::initI18n();
|
|
self::initI18n();
|
|
|
Minz_Error::error(403, ['error' => [_t('feedback.access.denied'), ' [CSRF]']]);
|
|
Minz_Error::error(403, ['error' => [_t('feedback.access.denied'), ' [CSRF]']]);
|
|
|
}
|
|
}
|