👽 Use capital to deal with mfa
This commit is contained in:
		| @@ -176,7 +176,7 @@ class PostEditorController extends GetxController { | ||||
|     visibleUsers.clear(); | ||||
|     invisibleUsers.clear(); | ||||
|     visibility.value = 0; | ||||
|     thumbnail.value = 0; | ||||
|     thumbnail.value = null; | ||||
|     publishedAt.value = null; | ||||
|     publishedUntil.value = null; | ||||
|     isDraft.value = false; | ||||
|   | ||||
| @@ -79,8 +79,8 @@ class _SignInPopupState extends State<SignInPopup> with ProtocolListener { | ||||
|                 onPressed: () { | ||||
|                   const redirect = 'solink://auth?status=done'; | ||||
|                   launchUrlString( | ||||
|                     ServiceFinder.buildUrl('passport', | ||||
|                         '/mfa?redirect_uri=$redirect&ticketId=${e.ticketId}'), | ||||
|                     ServiceFinder.buildUrl('capital', | ||||
|                         '/auth/mfa?redirect_uri=$redirect&ticketId=${e.ticketId}'), | ||||
|                     mode: LaunchMode.inAppWebView, | ||||
|                   ); | ||||
|                   Navigator.pop(context); | ||||
|   | ||||
| @@ -5,15 +5,15 @@ abstract class ServiceFinder { | ||||
|  | ||||
|   static const String dealerUrl = | ||||
|       devFlag ? 'http://localhost:8442' : 'https://api.sn.solsynth.dev'; | ||||
|   static const String passportUrl = | ||||
|       devFlag ? 'http://localhost:8444' : 'https://id.solsynth.dev'; | ||||
|   static const String capitalUrl = | ||||
|       devFlag ? 'http://localhost:8444' : 'https://solsynth.dev'; | ||||
|  | ||||
|   static String buildUrl(String serviceName, String? append) { | ||||
|     append ??= ''; | ||||
|     if (serviceName == 'dealer') { | ||||
|       return '$dealerUrl$append'; | ||||
|     } else if (serviceName == 'passport') { | ||||
|       return '$passportUrl$append'; | ||||
|     } else if (serviceName == 'capital') { | ||||
|       return '$capitalUrl$append'; | ||||
|     } | ||||
|     return '$dealerUrl/cgi/$serviceName$append'; | ||||
|   } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user