Skip to content

Commit

Permalink
Use full host url than just host domain
Browse files Browse the repository at this point in the history
  • Loading branch information
smartclash committed Nov 24, 2020
1 parent ceb5131 commit ed129bd
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/FormController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function __construct()

public function handleSubmission($email)
{
$url = request()->getUri();
$url = request()->headers->get('referer');
$account = Account::firstWhere('email', $email);
$website = $account->websites->firstWhere('url', $url);

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/CheckIfEmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class CheckIfEmail
*/
public function handle($request, Closure $next)
{
$host = $request->header('origin');
$host = $request->header('referer');
$validator = Validator::make(['email' => $request->route('email')], [
'email' => 'required|email'
]);
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Middleware/CheckIfVerified.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class CheckIfVerified
*/
public function handle($request, Closure $next)
{
$host = $request->header('origin');
$host = $request->header('referer');
$email = $request->route('email');

$account = Account::firstOrCreate(['email' => $email]);
Expand Down
2 changes: 1 addition & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
->middleware('auth')
->name('logout');
Route::get('auth/login/account/{account:id}', 'AuthController@loginUser')
->middleware('signed', 'guest')
->middleware('guest', 'signed')
->name('login.verify');

Route::get('verify/website/{website:id}', 'WebsiteController@verify')
Expand Down

0 comments on commit ed129bd

Please sign in to comment.