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 @@ + + +
+ + +
+ 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.
+