Finish account creation/login system

This commit is contained in:
zontreck 2024-05-16 18:49:59 -07:00
parent 579939a5f8
commit 15d03e8402

View file

@ -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