1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Got standard form-based registration working

This commit is contained in:
Dan Brown
2015-09-05 20:25:57 +01:00
parent 2c3fb557d6
commit dec0cbb1b2
17 changed files with 370 additions and 10 deletions

View File

@ -4,6 +4,7 @@ namespace Oxbow\Http\Middleware;
use Closure;
use Illuminate\Contracts\Auth\Guard;
use Oxbow\Exceptions\UserRegistrationException;
use Setting;
class Authenticate
@ -34,6 +35,9 @@ class Authenticate
*/
public function handle($request, Closure $next)
{
if(auth()->check() && auth()->user()->email_confirmed == false) {
return redirect()->guest('/register/confirm/awaiting');
}
if ($this->auth->guest() && !Setting::get('app-public')) {
if ($request->ajax()) {
return response('Unauthorized.', 401);