Skip to content
This repository was archived by the owner on Aug 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Http/Controllers/Cp/Auth/MagicLinkLoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ public function login(Request $request)
* the protected content feature.
*/
$user = User::findByEmail($request->get('user_email'));
if($user !== null) {
if ($user !== null) {
Auth::guard('web')->login($user);
}

$redirect = !empty($this->magicLinkManager->get()->get($user->email())['redirect_to'])
$redirect = ! empty($this->magicLinkManager->get()->get($user->email())['redirect_to'])
? route($this->magicLinkManager->get()->get($user->email())['redirect_to'])
: cp_route(config('statamic-magiclink.url.redirect_on_success'));

Expand Down
1 change: 0 additions & 1 deletion src/Http/Controllers/Cp/LinksController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use Carbon\Carbon;
use Codedge\MagicLink\MagicLinkManager;
use Illuminate\Http\Request;
use Statamic\CP\Column;

final class LinksController extends BaseCpController
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Middleware/MagicLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function handle(Request $request, Closure $next)
{
$previousRoute = $request->create(url()->previous());

if($request->has('referer')) {
if ($request->has('referer')) {
$previousRoute = $request->create($request->get('referer'));
}

Expand Down
2 changes: 0 additions & 2 deletions src/MagicLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Codedge\MagicLink;

use Carbon\Carbon;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\URL;
use Statamic\Contracts\Auth\User;

Expand All @@ -19,7 +18,6 @@ final class MagicLink
/**
* Redirect to the page after a successful login. This is either the CP dashboard or a page with protected
* content.
*
*/
protected string $redirectTo;
protected string $link;
Expand Down