Skip to content

Commit

Permalink
auth basic complete
Browse files Browse the repository at this point in the history
  • Loading branch information
abdullah579 committed Feb 22, 2024
1 parent 9660dd5 commit 2650bb3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/RegisteredUserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function store(Request $request)
$request->validate([
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'password' => ['required', 'confirmed', Rules\Password::defaults()],
'password' => ['required', 'confirmed', Rules\Password::min(8)->letters()],
]);

$user = User::create([
Expand Down
2 changes: 1 addition & 1 deletion app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Illuminate\Notifications\Notifiable;
use Laravel\Sanctum\HasApiTokens;

class User extends Authenticatable
class User extends Authenticatable implements MustVerifyEmail
{
use HasApiTokens, HasFactory, Notifiable;

Expand Down
4 changes: 2 additions & 2 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
// Task: this "/secretpage" URL should be visible only for those who VERIFIED their email
// Add some middleware here, and change some code in app/Models/User.php to enable this
Route::view('/secretpage', 'secretpage')
->name('secretpage');
->name('secretpage')->middleware(['auth','verified']);

// Task: this "/verysecretpage" URL should ask user for verifying their password once again
// You need to add some middleware here
Route::view('/verysecretpage', 'verysecretpage')
->name('verysecretpage');
->name('verysecretpage')->middleware(['auth','password.confirm']);

require __DIR__.'/auth.php';

0 comments on commit 2650bb3

Please sign in to comment.