From 65e153153f8203beff1df329783561e459e838be Mon Sep 17 00:00:00 2001 From: subhajit Date: Tue, 7 Jul 2026 16:53:32 +0530 Subject: [PATCH] update changes --- app/Http/Controllers/DashboardController.php | 25 ++ resources/views/sso/launch-app.blade.php | 248 +++++++++++++++++++ routes/web.php | 1 + 3 files changed, 274 insertions(+) create mode 100644 resources/views/sso/launch-app.blade.php diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php index 75cc94f..fe7c424 100644 --- a/app/Http/Controllers/DashboardController.php +++ b/app/Http/Controllers/DashboardController.php @@ -98,6 +98,31 @@ public function handleSSOCallback(Request $request) $targetUrl = session('sso_target_url', 'https://outlook.office.com/mail/'); session()->forget('sso_target_url'); + // If launching Microsoft Teams, redirect to the deep link launcher page + if (str_contains($targetUrl, 'teams.microsoft.com')) { + return redirect()->route('sso.launch-app', [ + 'name' => 'Microsoft Teams', + 'url' => $targetUrl, + 'protocol' => 'msteams://' + ]); + } + return redirect($targetUrl); } + + /** + * Render the desktop application launcher page with web fallback. + */ + public function launchApp(Request $request) + { + $name = $request->query('name', 'Application'); + $url = $request->query('url'); + $protocol = $request->query('protocol'); + + if (!$url || !$protocol) { + return redirect()->route('dashboard'); + } + + return view('sso.launch-app', compact('name', 'url', 'protocol')); + } } diff --git a/resources/views/sso/launch-app.blade.php b/resources/views/sso/launch-app.blade.php new file mode 100644 index 0000000..26aab7d --- /dev/null +++ b/resources/views/sso/launch-app.blade.php @@ -0,0 +1,248 @@ + + + + + + Launching {{ $name }} - SingleLogin + + + + + + + + + +
+
+
+
+
+

Opening {{ $name }} Desktop App

+

+ Attempting to launch the native {{ $name }} application on your device...
+ If you don't see the app opening, we will redirect you to the web version in a few seconds. +

+ + +
+ + + + diff --git a/routes/web.php b/routes/web.php index 71513b7..cf9facd 100644 --- a/routes/web.php +++ b/routes/web.php @@ -23,6 +23,7 @@ Route::get('/dashboard', [DashboardController::class, 'index'])->name('dashboard'); Route::get('/sso/launch/{id}', [DashboardController::class, 'launchSSO'])->name('sso.launch'); Route::get('/sso/callback', [DashboardController::class, 'handleSSOCallback'])->name('sso.callback'); + Route::get('/sso/launch-app', [DashboardController::class, 'launchApp'])->name('sso.launch-app'); }); // Admin Control Panel (requires admin role)