lang bugfix
All checks were successful
Build & Push Docker Image / docker (push) Successful in 1m48s
All checks were successful
Build & Push Docker Image / docker (push) Successful in 1m48s
This commit is contained in:
parent
7b5bd97215
commit
4aa98c1921
@ -9,6 +9,7 @@ use Illuminate\Auth\Events\Verified;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Password;
|
||||
|
||||
class VerifyEmailController extends Controller
|
||||
{
|
||||
@ -32,6 +33,15 @@ class VerifyEmailController extends Controller
|
||||
event(new Verified($user));
|
||||
}
|
||||
|
||||
if ($request->boolean('invite')) {
|
||||
$token = Password::createToken($user);
|
||||
|
||||
return redirect()->route('password.reset', [
|
||||
'token' => $token,
|
||||
'email' => $user->email,
|
||||
], absolute: false);
|
||||
}
|
||||
|
||||
if (Auth::check()) {
|
||||
$redirect = Auth::user()->role === UserType::STUDENT->value
|
||||
? route('student.index', ['tab' => 'courses'], absolute: false)
|
||||
|
||||
@ -13,13 +13,7 @@ class VerifyEmailNotification extends Notification
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
/**
|
||||
* Create a new notification instance.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
public function __construct(protected bool $invite = false) {}
|
||||
|
||||
/**
|
||||
* Get the notification's delivery channels.
|
||||
@ -39,13 +33,19 @@ class VerifyEmailNotification extends Notification
|
||||
*/
|
||||
protected function verificationUrl($notifiable)
|
||||
{
|
||||
$params = [
|
||||
'id' => $notifiable->getKey(),
|
||||
'hash' => sha1($notifiable->getEmailForVerification()),
|
||||
];
|
||||
|
||||
if ($this->invite) {
|
||||
$params['invite'] = 1;
|
||||
}
|
||||
|
||||
return URL::temporarySignedRoute(
|
||||
'verification.verify',
|
||||
now()->addMinutes(config('auth.verification.expire', 5)),
|
||||
[
|
||||
'id' => $notifiable->getKey(),
|
||||
'hash' => sha1($notifiable->getEmailForVerification()),
|
||||
]
|
||||
$params
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -51,7 +51,7 @@ class UserService
|
||||
]);
|
||||
|
||||
DB::afterCommit(function () use ($user) {
|
||||
$user->notify(new VerifyEmailNotification());
|
||||
$user->notify(new VerifyEmailNotification(true));
|
||||
});
|
||||
|
||||
return $user;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user