mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-05-20 07:26:58 -04:00
Compare commits
2 Commits
11a374765c
...
3098d1170f
Author | SHA1 | Date | |
---|---|---|---|
|
3098d1170f | ||
|
acf7ef28ab |
@ -32,12 +32,15 @@ impl AppStorage<'_> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get a value from the store (.data.json).
|
||||||
|
/// If the value is encrypted, it will be decrypted.
|
||||||
|
/// If the value is not found, or if there is an error, `None` is returned.
|
||||||
pub fn get<T: DeserializeOwned + Debug>(&self, hint: KeyHint) -> Option<T> {
|
pub fn get<T: DeserializeOwned + Debug>(&self, hint: KeyHint) -> Option<T> {
|
||||||
let stores = self.app_handle.state::<StoreCollection<Wry>>();
|
let stores = self.app_handle.state::<StoreCollection<Wry>>();
|
||||||
with_store(self.app_handle.clone(), stores, self.path, |store| {
|
with_store(self.app_handle.clone(), stores, self.path, |store| {
|
||||||
store
|
store
|
||||||
.get(hint.key)
|
.get(hint.key)
|
||||||
.ok_or_else(|| Error::Deserialize("Value not found".into()))
|
.ok_or_else(|| Error::Deserialize(format!("Key {} not found in store", hint.key).into()))
|
||||||
.and_then(|value| {
|
.and_then(|value| {
|
||||||
if !hint.encrypted {
|
if !hint.encrypted {
|
||||||
return Ok(serde_json::from_value::<T>(value.clone())?);
|
return Ok(serde_json::from_value::<T>(value.clone())?);
|
||||||
|
@ -58,7 +58,7 @@ export const loginPortalAtom = atom(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (userAuthCookie === "empty" || prelogonUserAuthCookie === "empty") {
|
if (userAuthCookie === "empty" || prelogonUserAuthCookie === "empty") {
|
||||||
throw new Error("Failed to login, please try again");
|
throw new Error("Got empty user auth cookie");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Here, we have got the portal config successfully, refresh the cached portal data
|
// Here, we have got the portal config successfully, refresh the cached portal data
|
||||||
|
@ -66,6 +66,7 @@ export default function PasswordAuth() {
|
|||||||
type="submit"
|
type="submit"
|
||||||
loading={loading}
|
loading={loading}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
|
sx={{ flex: 1 }}
|
||||||
>
|
>
|
||||||
Login
|
Login
|
||||||
</LoadingButton>
|
</LoadingButton>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user