Преглед изворни кода

Update logout and middleware

Vijayakrishnan Krishnan пре 4 година
родитељ
комит
e1d0950018

+ 2 - 0
.env.example

@@ -59,3 +59,5 @@ TWILIO_NUMBER=+12023359983
 MIX_APP_URL="http://app.lobby.localhost"
 
 BACKEND_URL="http://localhost:8080"
+
+AUTH_URL=http://localhost:3000

+ 1 - 25
app/Http/Middleware/ProAuthenticated.php

@@ -22,31 +22,7 @@ class ProAuthenticated
         $currentRouteName = $request->route()->getName();
 
         if (!$authenticated) {
-            return redirect()->route('login');
-        }
-
-        // - is_two_step_sms_auth_completed
-        if (!$appSession->is_two_step_sms_auth_completed) {
-            if ($currentRouteName != 'confirm_sms_auth_token' && $currentRouteName != 'post-confirm_sms_auth_token') {
-                return redirect()->route('confirm_sms_auth_token');
-            }
-            return $next($request);
-        }
-
-        // - is_password_temporary
-        if (!!$appSession->pro->is_password_temporary) {
-            if ($currentRouteName != 'set_password' && $currentRouteName != 'post-set_password') {
-                return redirect()->route('set_password');
-            }
-            return $next($request);
-        }
-
-        // - are_security_questions_set
-        if (!$appSession->pro->are_security_questions_set) {
-            if ($currentRouteName != 'set_security_questions' && $currentRouteName != 'post-set_security_questions') {
-                return redirect()->route('set_security_questions');
-            }
-            return $next($request);
+            return redirect(env('AUTH_URL'));
         }
 
         return $next($request);

+ 2 - 2
resources/views/layouts/pro-logged-in.blade.php

@@ -100,7 +100,7 @@
 
             <ul class="navbar-nav ml-2 ml-2">
                 <li class="nav-item">
-                    <a class="nav-link px-2" href="/api/session/logOut" target="_top" role="button" logout>
+                    <a class="nav-link px-2" href="{{ env('AUTH_URL') }}/logout" target="_top" role="button">
                         <i class="fas fa-sign-out-alt"></i>
                     </a>
                 </li>
@@ -345,4 +345,4 @@
 </body>
 
 </html>
-@endif
+@endif

+ 0 - 14
routes/web.php

@@ -31,20 +31,6 @@ Route::get('/join/{meetingID}', function () {
 Route::get('/meeting/{meetingID}/{participantID}', 'GuestController@meeting');
 */
 
-// client
-// =============================================================================================
-Route::middleware('ensureNoValidClientSession')->group(function() {
-    Route::get('/join', 'GuestController@join');
-    Route::post('/join', 'GuestController@processJoin');
-    Route::get('/client/checkin', 'GuestController@checkin');
-    Route::post('/client/checkin', 'GuestController@processCheckin');
-});
-Route::middleware('ensureValidClientSession')->group(function() {
-    Route::get('/get-client-checkin-token/{uid}', 'GuestController@getCheckinToken');
-    Route::get('/client/dashboard', 'GuestController@dashboard');
-});
-// =============================================================================================
-
 // pro
 // =============================================================================================
 Route::middleware('ensureNoValidProSession')->group(function() {