]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Controllers/Auth/AuthController.php
Updated laravel to 5.2 and started ldap implementation
[bookstack] / app / Http / Controllers / Auth / AuthController.php
index 507322c3dad3ebf107570110dd9e423022f7d1ef..c86e0d78991cf60cd24656a0f17b7d70b9802098 100644 (file)
@@ -29,7 +29,6 @@ class AuthController extends Controller
 
     use AuthenticatesAndRegistersUsers, ThrottlesLogins;
 
-    protected $loginPath = '/login';
     protected $redirectPath = '/';
     protected $redirectAfterLogout = '/login';
 
@@ -155,6 +154,7 @@ class AuthController extends Controller
             return redirect('/register/confirm');
         }
 
+        $newUser->email_confirmed = true;
         auth()->login($newUser);
         session()->flash('success', 'Thanks for signing up! You are now registered and signed in.');
         return redirect($this->redirectPath());
@@ -169,6 +169,18 @@ class AuthController extends Controller
         return view('auth/register-confirm');
     }
 
+    /**
+     * View the confirmation email as a standard web page.
+     * @param $token
+     * @return \Illuminate\View\View
+     * @throws UserRegistrationException
+     */
+    public function viewConfirmEmail($token)
+    {
+        $confirmation = $this->emailConfirmationService->getEmailConfirmationFromToken($token);
+        return view('emails/email-confirmation', ['token' => $confirmation->token]);
+    }
+
     /**
      * Confirms an email via a token and logs the user into the system.
      * @param $token
@@ -219,13 +231,9 @@ class AuthController extends Controller
      */
     public function getLogin()
     {
-
-        if (view()->exists('auth.authenticate')) {
-            return view('auth.authenticate');
-        }
-
         $socialDrivers = $this->socialAuthService->getActiveDrivers();
-        return view('auth.login', ['socialDrivers' => $socialDrivers]);
+        $authMethod = 'standard'; // TODO - rewrite to use config.
+        return view('auth/login', ['socialDrivers' => $socialDrivers, 'authMethod' => $authMethod]);
     }
 
     /**
@@ -240,7 +248,7 @@ class AuthController extends Controller
     }
 
     /**
-     * Redirect to the social site for authentication initended to register.
+     * Redirect to the social site for authentication intended to register.
      * @param $socialDriver
      * @return mixed
      */