public function testCheck() { Sentry::shouldReceive('check')->once()->withNoArgs()->andReturn(true); $this->assertTrue($this->auth->check()); Sentry::shouldReceive('check')->once()->withNoArgs()->andReturn(false); $this->assertFalse($this->auth->check()); }
public function filter($route, $request, $group) { $group = is_int($group) ? $this->groups->findById($group) : $this->groups->findByName($group); if ($group && (!$this->auth->check() || !$this->auth->getUser()->inGroup($group))) { return App::abort(401, 'You are not authorized.'); } }
/** * Attempt to activate user with code. * * @param int $id * @param string $code * @return \Illuminate\Http\RedirectResponse */ public function activate($id, $code) { if ($this->auth->check()) { return Redirect::route('profile.index'); } if ($this->users->activate($id, $code)) { return Redirect::route('session.create')->with('success_activation', true); } return Redirect::route('session.create')->with('error_activation', $this->users->getError()); }
public function filter() { if (!$this->auth->check()) { return App::abort(401, 'You are not authorized.'); } }