Compare commits
No commits in common. "efe979768c7ca0a999ae499d496cdaf66bdc636a" and "844097ecf099f1388dfa8338687ac4c21254e36b" have entirely different histories.
efe979768c
...
844097ecf0
4 changed files with 15 additions and 3 deletions
|
|
@ -24,9 +24,8 @@ class AddContentSecurityPolicy
|
|||
"style-src 'self' 'unsafe-inline' http: https:; " .
|
||||
"connect-src 'self' ws: http: https:;";
|
||||
} else {
|
||||
// Production CSP - Livewire v3 requires unsafe-eval and nonce for inline scripts
|
||||
$nonce = csp_nonce();
|
||||
$csp = "script-src 'self' 'unsafe-eval' 'nonce-{$nonce}' https:; " .
|
||||
// Production CSP - Livewire v3 requires unsafe-eval
|
||||
$csp = "script-src 'self' 'unsafe-eval' https:; " .
|
||||
"style-src 'self' 'unsafe-inline' https:; " .
|
||||
"connect-src 'self' https:;";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,8 +29,12 @@ class PasswordReset extends Component
|
|||
#[Layout('components.layouts.auth')]
|
||||
public function resetPassword()
|
||||
{
|
||||
logger()->info("Validating password reset...");
|
||||
logger()->info($this->form);
|
||||
$validated = $this->form->validate();
|
||||
|
||||
logger()->info("Validated password reset", $validated);
|
||||
|
||||
$status = Password::reset(array_merge($validated, ['token' => $this->token]),
|
||||
function (User $user, string $password) {
|
||||
$user->forceFill([
|
||||
|
|
@ -43,6 +47,7 @@ class PasswordReset extends Component
|
|||
return redirect()->route('login');
|
||||
}
|
||||
|
||||
logger()->error("Password reset failed", $status);
|
||||
$this->addError('email', 'The provided credentials do not match our records.');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,10 +18,16 @@ class RegisterUser extends Component
|
|||
|
||||
public function register()
|
||||
{
|
||||
logger()->info("Validating...");
|
||||
logger()->info($this->form->toArray());
|
||||
$validated = $this->form->validate();
|
||||
|
||||
logger()->info("Validated", $validated);
|
||||
$user = User::create($this->form->all());
|
||||
UserProfile::create(["user_id" => $user->id]);
|
||||
|
||||
Mail::to($user->email)->send(new PasswordResetNewUser($user));
|
||||
logger()->info("New user registered: " . $user->email);
|
||||
return redirect()->route('login');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,9 @@ class PasswordResetNewUser extends Mailable
|
|||
*/
|
||||
public function __construct(private User $user)
|
||||
{
|
||||
logger()->debug("\n==============================\n User email is $user->email. Username is $user->username \n=====================================");
|
||||
$this->token = Password::createToken($this->user);
|
||||
logger()->debug("Password reset token is $this->token");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue