-
-
Notifications
You must be signed in to change notification settings - Fork 15
feat: (LAR-107) Authentification avec Breeze #216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Stephen2304
merged 6 commits into
laravelcm:develop
from
Stephen2304:feature/LAR-107-modification-du-formulaire-de-mot-de-passe-oublier
Nov 12, 2024
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9647e17
feat: (LAR-107) Modification du formulaire de mot de passe oublié
Stephen2304 cd4c813
fix: (LAR-107) correction des conflits
Stephen2304 e3dfba4
feat: (LAR-107) Mise a jour
Stephen2304 583a633
feat: (LAR-107) Suppression des commentaire
Stephen2304 23882cf
fix: (LAR-107) suppresion du fichier auth-session
Stephen2304 a8cd309
fix: (LAR-107) correction des espaces
Stephen2304 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use App\Models\User; | ||
use Illuminate\Auth\Events\Verified; | ||
use Illuminate\Support\Facades\Event; | ||
use Illuminate\Support\Facades\URL; | ||
|
||
test('email verification screen can be rendered', function (): void { | ||
$user = User::factory()->unverified()->create(); | ||
|
||
$response = $this->actingAs($user)->get('/verify-email'); | ||
|
||
$response->assertStatus(200); | ||
}); | ||
|
||
test('email can be verified', function (): void { | ||
$user = User::factory()->unverified()->create(); | ||
|
||
Event::fake(); | ||
|
||
$verificationUrl = URL::temporarySignedRoute( | ||
'verification.verify', | ||
now()->addMinutes(60), | ||
['id' => $user->id, 'hash' => sha1($user->email)] | ||
); | ||
|
||
$response = $this->actingAs($user)->get($verificationUrl); | ||
|
||
Event::assertDispatched(Verified::class); | ||
expect($user->fresh()->hasVerifiedEmail())->toBeTrue(); | ||
$response->assertRedirect(route('dashboard', absolute: false).'?verified=1'); | ||
}); | ||
|
||
test('email is not verified with invalid hash', function (): void { | ||
$user = User::factory()->unverified()->create(); | ||
|
||
$verificationUrl = URL::temporarySignedRoute( | ||
'verification.verify', | ||
now()->addMinutes(60), | ||
['id' => $user->id, 'hash' => sha1('wrong-email')] | ||
); | ||
|
||
$this->actingAs($user)->get($verificationUrl); | ||
|
||
expect($user->fresh()->hasVerifiedEmail())->toBeFalse(); | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tests\Feature\Auth; | ||
|
||
use App\Models\User; | ||
use Livewire\Volt\Volt; | ||
|
||
test('confirm password screen can be rendered', function (): void { | ||
$user = User::factory()->create(); | ||
|
||
$response = $this->actingAs($user)->get('/confirm-password'); | ||
|
||
$response | ||
->assertSeeVolt('pages.auth.confirm-password') | ||
->assertStatus(200); | ||
}); | ||
|
||
test('password can be confirmed', function (): void { | ||
$user = User::factory()->create(); | ||
|
||
$this->actingAs($user); | ||
|
||
$component = Volt::test('pages.auth.confirm-password') | ||
->set('password', 'password'); | ||
|
||
$component->call('confirmPassword'); | ||
|
||
$component | ||
->assertRedirect('/dashboard') | ||
->assertHasNoErrors(); | ||
}); | ||
|
||
test('password is not confirmed with invalid password', function (): void { | ||
$user = User::factory()->create(); | ||
|
||
$this->actingAs($user); | ||
|
||
$component = Volt::test('pages.auth.confirm-password') | ||
->set('password', 'wrong-password'); | ||
|
||
$component->call('confirmPassword'); | ||
|
||
$component | ||
->assertNoRedirect() | ||
->assertHasErrors('password'); | ||
}); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.