-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename to single factor auth flutter
- Loading branch information
1 parent
3d45523
commit 388bb6e
Showing
28 changed files
with
131 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,21 @@ | ||
TODO: Add your license here. | ||
MIT License | ||
|
||
Copyright (c) 2020 Torus | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
rootProject.name = 'single_fact_auth_flutter' | ||
rootProject.name = 'single_factor_auth_flutter' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.web3auth.single_fact_auth_flutter"> | ||
package="com.web3auth.single_factor_auth_flutter"> | ||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ngle_fact_auth_flutter/Web3AuthNetwork.kt → ...le_factor_auth_flutter/Web3AuthNetwork.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
package com.web3auth.single_fact_auth_flutter | ||
package com.web3auth.single_factor_auth_flutter | ||
|
||
data class Web3AuthNetwork(val network: String) |
2 changes: 1 addition & 1 deletion
2
...ngle_fact_auth_flutter/Web3AuthOptions.kt → ...le_factor_auth_flutter/Web3AuthOptions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...fact_auth_flutter_example/MainActivity.kt → ...ctor_auth_flutter_example/MainActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ import 'dart:async'; | |
import 'dart:io'; | ||
|
||
import 'package:flutter/material.dart'; | ||
import 'package:single_fact_auth_flutter/input.dart'; | ||
import 'package:single_fact_auth_flutter/single_fact_auth_flutter.dart'; | ||
import 'package:single_factor_auth_flutter/input.dart'; | ||
import 'package:single_factor_auth_flutter/single_factor_auth_flutter.dart'; | ||
|
||
void main() { | ||
runApp(const MyApp()); | ||
|
@@ -17,7 +17,7 @@ class MyApp extends StatefulWidget { | |
} | ||
|
||
class _MyAppState extends State<MyApp> { | ||
final _singleFactAuthFlutterPlugin = SingleFactAuthFlutter(); | ||
final _SingleFactorAuthFlutterPlugin = SingleFactAuthFlutter(); | ||
String _result = ''; | ||
bool logoutVisible = false; | ||
TorusNetwork torusNetwork = TorusNetwork.testnet; | ||
|
@@ -29,29 +29,30 @@ class _MyAppState extends State<MyApp> { | |
} | ||
|
||
Future<void> initSdk() async { | ||
if(Platform.isAndroid) { | ||
init().then((value) => initialize()); | ||
if (Platform.isAndroid) { | ||
init().then((value) => initialize()); | ||
} else if (Platform.isIOS) { | ||
init(); | ||
initialize(); | ||
} else {} | ||
init(); | ||
initialize(); | ||
} else {} | ||
} | ||
|
||
Future<void> init() async { | ||
await _singleFactAuthFlutterPlugin | ||
.init(Web3AuthNetwork(network: torusNetwork)); | ||
await _SingleFactorAuthFlutterPlugin.init( | ||
Web3AuthNetwork(network: torusNetwork)); | ||
} | ||
|
||
Future<void> initialize() async { | ||
print("initialize() called"); | ||
final String torusKey = await _singleFactAuthFlutterPlugin.initialize(); | ||
final String torusKey = await _SingleFactorAuthFlutterPlugin.initialize(); | ||
if (torusKey.isNotEmpty) { | ||
setState(() { | ||
_result = "Private Key : $torusKey"; | ||
}); | ||
} | ||
} | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return MaterialApp( | ||
home: Scaffold( | ||
|
@@ -129,7 +130,7 @@ class _MyAppState extends State<MyApp> { | |
try { | ||
final String response = await method(); | ||
setState(() { | ||
_result = "Private Key : $response"; | ||
_result = "Private Key : $response"; | ||
}); | ||
} on UserCancelledException { | ||
print("User cancelled."); | ||
|
@@ -142,7 +143,8 @@ class _MyAppState extends State<MyApp> { | |
VoidCallback _initialize() { | ||
return () async { | ||
try { | ||
final String response = await _singleFactAuthFlutterPlugin.initialize(); | ||
final String response = | ||
await _SingleFactorAuthFlutterPlugin.initialize(); | ||
setState(() { | ||
_result = "Private Key : $response"; | ||
}); | ||
|
@@ -155,14 +157,14 @@ class _MyAppState extends State<MyApp> { | |
} | ||
|
||
Future<String> testnetTorusKey() { | ||
return _singleFactAuthFlutterPlugin.getTorusKey(Web3AuthOptions( | ||
return _SingleFactorAuthFlutterPlugin.getTorusKey(Web3AuthOptions( | ||
verifier: 'torus-test-health', | ||
email: '[email protected]', | ||
idToken: Utils().es256Token("[email protected]"))); | ||
} | ||
|
||
Future<String> getAggregrateTorusKey() { | ||
return _singleFactAuthFlutterPlugin.getAggregateTorusKey(Web3AuthOptions( | ||
return _SingleFactorAuthFlutterPlugin.getAggregateTorusKey(Web3AuthOptions( | ||
verifier: 'torus-test-health', | ||
email: '[email protected]', | ||
idToken: Utils().es256Token("[email protected]"), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
ios/single_fact_auth_flutter.podspec → ios/single_factor_auth_flutter.podspec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.