Skip to content

Commit

Permalink
Hotfix: Fix Authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
Thiritin committed Sep 8, 2024
1 parent 11fbb84 commit ff8a775
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function loginCallback()
);

Auth::login($user);
return redirect()->route('pos.dashboard');
return redirect()->route('dashboard');
}

public function logout()
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/POS/Auth/MachineLoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public function __invoke(Request $request)
$machine = Machine::findOrFail($data['machine_id']);
Auth::guard('machine')->login($machine, true);

return Redirect::route('pos.auth.user.login');
return Redirect::route('pos.auth.user.select');
}
}
2 changes: 0 additions & 2 deletions app/Http/Controllers/POS/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ class DashboardController extends Controller
{
public function __invoke()
{
print_r(Auth::guard('machine-user')->user()); // returns App\Models\User

return Inertia::render('POS/Dashboard');
}
}
3 changes: 1 addition & 2 deletions bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
->name('fcea.')
->middleware('web')
->group(base_path('routes/fcea.php'));
\Illuminate\Support\Facades\Route::middleware(['auth:machine','auth:machine-user'])
\Illuminate\Support\Facades\Route::middleware(['auth:machine','auth:machine-user','web'])
->prefix('pos/')
->name('pos.')
->middleware('web')
->group(base_path('routes/pos.php'));
\Illuminate\Support\Facades\Route::prefix('pos/auth/')
->name('pos.auth.')
Expand Down
1 change: 0 additions & 1 deletion routes/pos.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@
Route::get('/lookup', [\App\Http\Controllers\POS\AttendeeController::class, 'lookupForm'])->name('lookup');
Route::post('/lookup', [\App\Http\Controllers\POS\AttendeeController::class, 'lookupSubmit'])->name('lookup.submit');
Route::get('/show/{attendeeId}', [\App\Http\Controllers\POS\AttendeeController::class, 'attendeeShow'])->name('show');

});

0 comments on commit ff8a775

Please sign in to comment.