| Total Complexity | 5 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class InviteController extends Controller |
||
| 15 | { |
||
| 16 | public function __construct() |
||
| 17 | { |
||
| 18 | $this->middleware(['chief-validate-invite'])->except('expired'); |
||
| 19 | } |
||
| 20 | |||
| 21 | public function expired() |
||
| 24 | } |
||
| 25 | |||
| 26 | public function accept(Request $request) |
||
| 27 | { |
||
| 28 | $invitation = Invitation::findByToken($request->token); |
||
| 29 | |||
| 30 | app(AcceptInvite::class)->handle($invitation); |
||
| 31 | |||
| 32 | // Log user into the system and proceed to start page |
||
| 33 | auth()->guard('chief')->login($invitation->invitee); |
||
| 34 | |||
| 35 | if (is_null($invitation->invitee->password)) { |
||
|
|
|||
| 36 | return redirect()->route('chief.back.password.edit'); |
||
| 37 | } |
||
| 38 | |||
| 39 | return redirect()->route('chief.back.dashboard.getting-started'); |
||
| 40 | } |
||
| 41 | |||
| 42 | public function deny(Request $request) |
||
| 49 | } |
||
| 50 | } |
||
| 51 |