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:; " .
|
"style-src 'self' 'unsafe-inline' http: https:; " .
|
||||||
"connect-src 'self' ws: http: https:;";
|
"connect-src 'self' ws: http: https:;";
|
||||||
} else {
|
} else {
|
||||||
// Production CSP - Livewire v3 requires unsafe-eval and nonce for inline scripts
|
// Production CSP - Livewire v3 requires unsafe-eval
|
||||||
$nonce = csp_nonce();
|
$csp = "script-src 'self' 'unsafe-eval' https:; " .
|
||||||
$csp = "script-src 'self' 'unsafe-eval' 'nonce-{$nonce}' https:; " .
|
|
||||||
"style-src 'self' 'unsafe-inline' https:; " .
|
"style-src 'self' 'unsafe-inline' https:; " .
|
||||||
"connect-src 'self' https:;";
|
"connect-src 'self' https:;";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,12 @@ class PasswordReset extends Component
|
||||||
#[Layout('components.layouts.auth')]
|
#[Layout('components.layouts.auth')]
|
||||||
public function resetPassword()
|
public function resetPassword()
|
||||||
{
|
{
|
||||||
|
logger()->info("Validating password reset...");
|
||||||
|
logger()->info($this->form);
|
||||||
$validated = $this->form->validate();
|
$validated = $this->form->validate();
|
||||||
|
|
||||||
|
logger()->info("Validated password reset", $validated);
|
||||||
|
|
||||||
$status = Password::reset(array_merge($validated, ['token' => $this->token]),
|
$status = Password::reset(array_merge($validated, ['token' => $this->token]),
|
||||||
function (User $user, string $password) {
|
function (User $user, string $password) {
|
||||||
$user->forceFill([
|
$user->forceFill([
|
||||||
|
|
@ -43,6 +47,7 @@ class PasswordReset extends Component
|
||||||
return redirect()->route('login');
|
return redirect()->route('login');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger()->error("Password reset failed", $status);
|
||||||
$this->addError('email', 'The provided credentials do not match our records.');
|
$this->addError('email', 'The provided credentials do not match our records.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,16 @@ class RegisterUser extends Component
|
||||||
|
|
||||||
public function register()
|
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());
|
$user = User::create($this->form->all());
|
||||||
UserProfile::create(["user_id" => $user->id]);
|
UserProfile::create(["user_id" => $user->id]);
|
||||||
|
|
||||||
Mail::to($user->email)->send(new PasswordResetNewUser($user));
|
Mail::to($user->email)->send(new PasswordResetNewUser($user));
|
||||||
|
logger()->info("New user registered: " . $user->email);
|
||||||
return redirect()->route('login');
|
return redirect()->route('login');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,9 @@ class PasswordResetNewUser extends Mailable
|
||||||
*/
|
*/
|
||||||
public function __construct(private User $user)
|
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);
|
$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