Advertisement
hasancse1991

Torus login with Google

Jun 16th, 2021
1,229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 1.15 KB | None | 0 0
  1. _googleLogin() async {
  2.     bool success;
  3.     if (Platform.isIOS) {
  4.       success = await TorusDirect.setVerifierDetails(
  5.           LoginType.installed.value,
  6.           VerifierType.singleLogin.value,
  7.           "samtwo-google",
  8.           "360801018673-1tmrfbvc2og29c8lmoljpl16ptkc20b3.apps.googleusercontent.com",
  9.           LoginProvider.google.value,
  10.           "samtwo-google",
  11.           "com.googleusercontent.apps.360801018673-1tmrfbvc2og29c8lmoljpl16ptkc20b3:/oauthredirect");
  12.     } else {
  13.       success = await TorusDirect.setVerifierDetails(
  14.           LoginType.installed.value,
  15.           VerifierType.singleLogin.value,
  16.           "google-lrc",
  17.           "221898609709-obfn3p63741l5333093430j3qeiinaa8.apps.googleusercontent.com",
  18.           LoginProvider.google.value,
  19.           "google-lrc",
  20.           "com.googleusercontent.apps.221898609709-obfn3p63741l5333093430j3qeiinaa8:/oauthredirect");
  21.     }
  22.  
  23.     print(success);
  24.  
  25.     Map<dynamic, dynamic> _torusLoginInfo;
  26.     _torusLoginInfo = await TorusDirect.triggerLogin();
  27.  
  28.     setState(() {
  29.       _privateKey = _torusLoginInfo['privateKey'];
  30.       _currentVerifier = "Google";
  31.     });
  32.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement