1
0
forked from baron/baron-sso

feat: SSO 로그인 리다이렉션 흐름 구현 (userfront & adminfront 연동) #243

This commit is contained in:
2026-02-11 15:20:17 +09:00
parent 3163514227
commit 9d7c28b1c1
5 changed files with 83 additions and 6 deletions

View File

@@ -5,6 +5,21 @@ import 'dart:html' as html;
import 'package:flutter/foundation.dart';
void implSendLoginSuccess(String token) {
final uri = Uri.parse(html.window.location.href);
final redirectUri = uri.queryParameters['redirect_uri'];
if (redirectUri != null && redirectUri.isNotEmpty) {
// Redirection flow
final target = Uri.parse(redirectUri);
final query = Map<String, String>.from(target.queryParameters);
query['token'] = token;
final finalUri = target.replace(queryParameters: query);
debugPrint('Redirecting to: ${finalUri.toString()}');
html.window.location.href = finalUri.toString();
return;
}
final message = {'type': 'LOGIN_SUCCESS', 'token': token};
if (html.window.opener != null) {

View File

@@ -98,6 +98,13 @@ final _router = GoRouter(
return LoginScreen(key: state.pageKey, loginChallenge: loginChallenge);
},
),
GoRoute(
path: '/ssologin',
builder: (context, state) {
_routerLogger.info("Navigating to /ssologin");
return LoginScreen(key: state.pageKey);
},
),
GoRoute(
path: '/login',
builder: (context, state) {