be absolutely sure we delete secure storage keys before writing them (#1182)

* be absolutely sure we delete secure storage keys before writing them

* sync with other PR

---------

Co-authored-by: fossephate <fosse@book.local>
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
Matthew Fosse
2023-11-27 15:28:34 +02:00
committed by GitHub
co-authored by fossephate Omar Hatem
parent 00c97c74b8
commit 615d016dd5
7 changed files with 15 additions and 3 deletions
@@ -57,6 +57,8 @@ class ChatwootWidgetState extends State<ChatwootWidget> {
return true;
}
Future<void> storeCookie(String value) async =>
await widget.secureStorage.write(key: COOKIE_KEY, value: value);
Future<void> storeCookie(String value) async {
await widget.secureStorage.delete(key: COOKIE_KEY);
await widget.secureStorage.write(key: COOKIE_KEY, value: value);
}
}