+ Grant Change Demo +
++ This page demonstrates the auto logout feature when grant changes are + detected. +
++ Connection Status +
+ +Wallet:
++ {account.bech32Address} +
+Treasury:
++ {treasuryConfig.treasury || "Not set"} +
++ Feature Information +
+ +Auto Logout
++ When enabled, users are automatically logged out if grant + changes are detected at startup. +
+Grant Monitoring
++ The system checks for grant changes when the app starts, + comparing current grants with treasury configuration. +
++ Developer Control +
++ Developers can access the `grantsChanged` property to implement + custom handling and user notifications. +
+Configuration
++ Set `enableLogoutOnGrantChange: true` in your provider config to + enable automatic logout. +
+Activity Log
+ +No activity yet...
+ ) : ( ++ Implementation Example +
+ +
+ {`// Enable auto logout in provider config
+const config = {
+ treasury: "xion1...",
+ enableLogoutOnGrantChange: true
+};
+
+// Use in components
+const { grantsChanged, isConnected } = useAbstraxionAccount();
+
+useEffect(() => {
+ if (grantsChanged && !isConnected) {
+ // Handle grant changes with custom UX
+ showNotification("Permissions updated. Please reconnect.");
+ }
+}, [grantsChanged, isConnected]);`}
+
+