Browse Source

Fix OAuth

fix https://github.com/forkbb/forkbb/commit/9cfd336e7f2aef8d7ab7cf85f566b4fac91f2223
Visman 1 year ago
parent
commit
d10d8aa2c9
1 changed files with 12 additions and 9 deletions
  1. 12 9
      app/Controllers/Routing.php

+ 12 - 9
app/Controllers/Routing.php

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