mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
Added social sign in
This commit is contained in:
@ -22,8 +22,7 @@ class Handler extends ExceptionHandler
|
||||
*
|
||||
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
|
||||
*
|
||||
* @param \Exception $e
|
||||
* @return void
|
||||
* @param \Exception $e
|
||||
*/
|
||||
public function report(Exception $e)
|
||||
{
|
||||
@ -39,6 +38,11 @@ class Handler extends ExceptionHandler
|
||||
*/
|
||||
public function render($request, Exception $e)
|
||||
{
|
||||
if($e instanceof NotifyException) {
|
||||
\Session::flash('error', $e->message);
|
||||
return response()->redirectTo($e->redirectLocation);
|
||||
}
|
||||
|
||||
return parent::render($request, $e);
|
||||
}
|
||||
}
|
||||
|
21
app/Exceptions/NotifyException.php
Normal file
21
app/Exceptions/NotifyException.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php namespace Oxbow\Exceptions;
|
||||
|
||||
|
||||
class NotifyException extends \Exception
|
||||
{
|
||||
|
||||
public $message;
|
||||
public $redirectLocation;
|
||||
|
||||
/**
|
||||
* NotifyException constructor.
|
||||
* @param string $message
|
||||
* @param string $redirectLocation
|
||||
*/
|
||||
public function __construct($message, $redirectLocation)
|
||||
{
|
||||
$this->message = $message;
|
||||
$this->redirectLocation = $redirectLocation;
|
||||
parent::__construct();
|
||||
}
|
||||
}
|
6
app/Exceptions/SocialDriverNotConfigured.php
Normal file
6
app/Exceptions/SocialDriverNotConfigured.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php namespace Oxbow\Exceptions;
|
||||
|
||||
|
||||
class SocialDriverNotConfigured extends \Exception
|
||||
{
|
||||
}
|
7
app/Exceptions/UserNotFound.php
Normal file
7
app/Exceptions/UserNotFound.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php namespace Oxbow\Exceptions;
|
||||
|
||||
|
||||
class UserNotFound extends NotifyException
|
||||
{
|
||||
|
||||
}
|
Reference in New Issue
Block a user