forked from baron/baron-sso
QR 로그인 구현 완료
This commit is contained in:
@@ -288,33 +288,36 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
||||
timer.cancel();
|
||||
_qrCountdownTimer?.cancel();
|
||||
|
||||
final jwt = res['sessionJwt'];
|
||||
final displayName = _getLoginIdFromJwt(jwt);
|
||||
// Create User & Session for Descope SDK
|
||||
final dummyUser = DescopeUser(
|
||||
'unknown', // userId
|
||||
[], // loginIds
|
||||
0, // createdAt
|
||||
displayName, // name
|
||||
null, // picture (Uri?)
|
||||
'', // email
|
||||
false, // isVerifiedEmail
|
||||
'', // phone
|
||||
false, // isVerifiedPhone
|
||||
{}, // customAttributes
|
||||
'', // givenName
|
||||
'', // middleName
|
||||
'', // familyName
|
||||
false, // hasPassword
|
||||
'enabled', // status
|
||||
[], // roleNames
|
||||
[], // ssoAppIds
|
||||
[], // oauthProviders (List<String>)
|
||||
);
|
||||
final session = DescopeSession.fromJwt(jwt, jwt, dummyUser);
|
||||
Descope.sessionManager.manageSession(session);
|
||||
final token = res['sessionJwt'] as String;
|
||||
final isJwt = token.split('.').length == 3;
|
||||
if (isJwt) {
|
||||
final displayName = _getLoginIdFromJwt(token);
|
||||
// Create User & Session for Descope SDK
|
||||
final dummyUser = DescopeUser(
|
||||
'unknown', // userId
|
||||
[], // loginIds
|
||||
0, // createdAt
|
||||
displayName, // name
|
||||
null, // picture (Uri?)
|
||||
'', // email
|
||||
false, // isVerifiedEmail
|
||||
'', // phone
|
||||
false, // isVerifiedPhone
|
||||
{}, // customAttributes
|
||||
'', // givenName
|
||||
'', // middleName
|
||||
'', // familyName
|
||||
false, // hasPassword
|
||||
'enabled', // status
|
||||
[], // roleNames
|
||||
[], // ssoAppIds
|
||||
[], // oauthProviders (List<String>)
|
||||
);
|
||||
final session = DescopeSession.fromJwt(token, token, dummyUser);
|
||||
Descope.sessionManager.manageSession(session);
|
||||
}
|
||||
|
||||
_onLoginSuccess(jwt);
|
||||
_onLoginSuccess(token);
|
||||
}
|
||||
} catch (e) {
|
||||
debugPrint("[QR] Polling error: $e");
|
||||
@@ -906,8 +909,10 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
||||
controller: _shortCodePrefixController,
|
||||
textCapitalization: TextCapitalization.characters,
|
||||
decoration: const InputDecoration(
|
||||
labelText: "AA",
|
||||
labelText: "영문 2자리",
|
||||
border: OutlineInputBorder(),
|
||||
hintText: "AB",
|
||||
hintStyle: TextStyle(color: Colors.grey),
|
||||
),
|
||||
maxLength: 2,
|
||||
),
|
||||
@@ -919,11 +924,13 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
|
||||
controller: _shortCodeDigitsController,
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: InputDecoration(
|
||||
labelText: "000000",
|
||||
labelText: "숫자 6자리",
|
||||
border: const OutlineInputBorder(),
|
||||
hintText: _linkExpireSeconds > 0
|
||||
hintText: "345678",
|
||||
hintStyle: const TextStyle(color: Colors.grey),
|
||||
suffixText: _linkExpireSeconds > 0
|
||||
? "유효시간 ${_formatTime(_linkExpireSeconds)}"
|
||||
: "000000",
|
||||
: null,
|
||||
),
|
||||
maxLength: 6,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user