Skip to content

Commit

Permalink
Merge pull request #35 from codebar-ag/feature-fixes
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
StanBarrows authored Oct 25, 2023
2 parents 4957827 + d75c034 commit 9775203
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions config/laravel-auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@
|--------------------------------------------------------------------------
| Password Reset Settings
|--------------------------------------------------------------------------
| By default, the package will use the password_resets table.
| By default, the package will use the password_reset_tokens table.
| You may define a different table name here.
|
*/
'password_reset_table' => 'password_resets',
'password_reset_table' => 'password_reset_tokens',

/*
|--------------------------------------------------------------------------
Expand Down
6 changes: 4 additions & 2 deletions src/Controllers/ResetPasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ public function index()

public function store(ResetPasswordRequest $request)
{
$reset = DB::table('password_resets')
$table = config('laravel-auth.password_reset_table', 'password_reset_tokens');

$reset = DB::table($table)
->where('token', $request->validated('token'))
->sole();

Expand Down Expand Up @@ -58,7 +60,7 @@ public function store(ResetPasswordRequest $request)
]);
}

DB::table('password_resets')->where('token', $request->validated('token'))->delete();
DB::table($table)->where('token', $request->validated('token'))->delete();

session()->regenerate();

Expand Down
2 changes: 1 addition & 1 deletion src/Jobs/RequestPasswordJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected function processRequest(): void
->where('email', $this->email)
->sole();

$table = config('laravel-auth.password_reset_table', 'password_resets');
$table = config('laravel-auth.password_reset_table', 'password_reset_tokens');

DB::table($table)->where('email', $this->email)->delete();

Expand Down

0 comments on commit 9775203

Please sign in to comment.