mirror of
https://git.proxmox.com/git/flutter/proxmox_login_manager.git
synced 2025-12-06 09:42:28 +00:00
No description
Signed-off-by: Shan Shaji <s.shaji@proxmox.com> Link: https://lore.proxmox.com/20251111140005.41510-5-s.shaji@proxmox.com |
||
|---|---|---|
| assets | ||
| lib | ||
| test | ||
| .gitignore | ||
| .metadata | ||
| analysis_options.yaml | ||
| LICENSE | ||
| pubspec.lock | ||
| pubspec.yaml | ||
| README.md | ||
proxmox_login_manager
A basic login management library which handles authentication in combination with the proxmox_dart_api_client library.
You need to build the model classes before using it, to do this use:
flutter packages pub run build_runner build
Basic usage:
ProxmoxLoginSelector(
onLogin: (ProxmoxApiClient client) => whatever you want to do with the client,
),
This will give you an authenticated ProxmoxApiClient for usage in your project.
The latest session will be saved and can be recovered.
loginStorage = await ProxmoxLoginStorage.fromLocalStorage();
final apiClient = await loginStorage.recoverLatestSession();
This will either return an authenticated ProxmoxApiClient or will result in an Exception (ProxmoxApiException).
To clear all session on logout you can use:
ProxmoxLoginStorage.fromLocalStorage()
.then((storage) => storage?.invalidateAllSessions());