Browse Source

Minor changes

Visman 1 year ago
parent
commit
9cfd336e7f
2 changed files with 10 additions and 13 deletions
  1. 9 12
      app/Controllers/Routing.php
  2. 1 1
      app/Models/Pages/Auth.php

+ 9 - 12
app/Controllers/Routing.php

@@ -97,18 +97,6 @@ class Routing
         }
 
         // OAuth
-        if (
-            $user->isAdmin
-            || 1 === $config->b_oauth_allow
-        ) {
-            $r->add(
-                $r::GET,
-                '/reglog/callback/{name}',
-                'RegLog:callback',
-                'RegLogCallback'
-            );
-        }
-
         if (1 === $config->b_oauth_allow) {
             $r->add(
                 $r::PST,
@@ -116,6 +104,15 @@ class Routing
                 'RegLog:redirect',
                 'RegLogRedirect'
             );
+
+            if ($user->isAdmin) {
+                $r->add(
+                    $r::GET,
+                    '/reglog/callback/{name}',
+                    'RegLog:callback',
+                    'RegLogCallback'
+                );
+            }
         }
 
         // просмотр разрешен

+ 1 - 1
app/Models/Pages/Auth.php

@@ -206,7 +206,7 @@ class Auth extends Page
     /**
      * Проверка пользователя по базе
      */
-    public function vLoginCheck(Validator $v, #[SensitiveParameter] string $password ): string
+    public function vLoginCheck(Validator $v, #[SensitiveParameter] string $password): string
     {
         if (empty($v->getErrors())) {
             if ($this->loginWithForm) {