Skip to content

Commit

Permalink
Merge pull request #46 from sushmashivakavi/cpass-penetration-login-g…
Browse files Browse the repository at this point in the history
…et-to-post-request-changes

feat:cpass penentration login get to post change
  • Loading branch information
sankarsuda committed Oct 5, 2023
2 parents a29de2f + e1d39e2 commit 22b8632
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
'prefix' => $prefix,
'as' => $as
], function (): void {
Route::get('account/sniff/{id}', 'Account\Controller@sniff');
// Authentication Routes...
Route::get('login', 'Auth\LoginController@showLoginForm')->name('login');
Route::post('login', 'Auth\LoginController@login');
Expand Down Expand Up @@ -53,6 +52,8 @@
'prefix' => $prefix,
'as' => $as
], function (): void {
Route::match(['get', 'post'],'account/sniff/{id?}', 'Account\Controller@sniff');

Route::get('activate', 'Auth\ActivationController@activate')->name('user.activate');
Route::any('logout', 'Auth\LoginController@logout')->name('logout');

Expand Down
4 changes: 3 additions & 1 deletion src/Http/Controllers/Account/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,14 @@ public function password(): array
];
}

public function sniff(string $key)
public function sniff(string $key = null)
{
$decrypted = null;
session()->forget('sniffed');
session()->forget('sniff');

$key = $this->post("key", $key);

try {
$decrypted = decrypt($key);
} catch (DecryptException $e) {
Expand Down

0 comments on commit 22b8632

Please sign in to comment.