forked from baron/baron-sso
16 lines
514 B
Dart
16 lines
514 B
Dart
bool shouldPromoteCookieSession({
|
|
required String? currentToken,
|
|
required String? loginChallenge,
|
|
}) {
|
|
final hasToken = currentToken != null && currentToken.trim().isNotEmpty;
|
|
final hasChallenge =
|
|
loginChallenge != null && loginChallenge.trim().isNotEmpty;
|
|
|
|
// 토큰 기반 세션이 이미 확보된 일반 로그인 흐름에서는
|
|
// 뒤늦은 쿠키 세션 승격이 토큰을 덮어쓰지 않도록 차단합니다.
|
|
if (hasToken && !hasChallenge) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|