Finish account creation/login system
This commit is contained in:
parent
579939a5f8
commit
15d03e8402
1 changed files with 13 additions and 4 deletions
|
@ -154,11 +154,19 @@ class OpenSimPageState extends State<OpenSimPage> {
|
|||
|
||||
if (settings.loggedIn && !settings.currentUser!.active && !activating) {
|
||||
activating = true;
|
||||
showDialog(
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (B) {
|
||||
return CreateInventoryPopup();
|
||||
});
|
||||
activating = false;
|
||||
// Force user to re-login
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
prefs.clear();
|
||||
setState(() {
|
||||
settings.loggedIn = false;
|
||||
settings.currentUser = null;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -210,15 +218,16 @@ class OpenSimPageState extends State<OpenSimPage> {
|
|||
ElevatedButton(
|
||||
onPressed: () async {
|
||||
settings.loggedIn = false;
|
||||
|
||||
var loginToken = settings
|
||||
.currentUser!.loginToken;
|
||||
settings.currentUser = null;
|
||||
|
||||
await settings
|
||||
.sendPacketToEndpoint(
|
||||
APIEndpoint.Logout,
|
||||
C2SLogoutPacket(
|
||||
ID: settings
|
||||
.currentUser!
|
||||
.loginToken));
|
||||
ID: loginToken));
|
||||
|
||||
SharedPreferences prefs =
|
||||
await SharedPreferences
|
||||
|
|
Loading…
Reference in a new issue