From d4b99b8d71ef4c8da26c98e496e222979d29b1ed Mon Sep 17 00:00:00 2001 From: Bruno D'Luka Date: Sat, 20 Aug 2022 10:08:10 -0300 Subject: [PATCH 1/2] Update README.md --- README.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 003129d2..bfffc0dc 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Supabase is an open source Firebase alternative. We are a service to: ## Features -- [x] Null-safety +- ✅ Null-safety | Platform | Email Auth | Provider Auth | Database | Realtime | Storage | | -------- | :--------: | :-----------: | :------: | :------: | :-----: | @@ -327,9 +327,20 @@ Supabase.instance.client.auth.signInWithProvider( ### Custom LocalStorage -As default `supabase_flutter` uses [`hive`](https://pub.dev/packages/hive) plugin to persist user session. However you can use any other plugins by creating a `LocalStorage` impl. +As default, `supabase_flutter` uses [`hive`](https://pub.dev/packages/hive) to persist user session. Encryption is disabled by default, since it's necessary a unique key we can not define. To set an `encryptionKey`, do the following: -For example, we can use `flutter_secure_storage` plugin to store the user session in a secure storage. +```dart +void main() { + // set it before initializing + HiveLocalStorage.encryptionKey = 'my_secure_key'; + Supabase.initialize(...); +} +``` + +**Note** the key must be the same. There is no check if the encryption key is correct. If it isn't, there may be unexpected behavior. [Learn more](https://docs.hivedb.dev/#/advanced/encrypted_box) about encryption in hive. + + +However you can use any other methods by creating a `LocalStorage` implementation. For example, we can use [`flutter_secure_storage`](https://pub.dev/packages/flutter_secure_storage) plugin to store the user session in a secure storage. ```dart // Define the custom LocalStorage implementation @@ -359,7 +370,7 @@ Supabase.initialize( ); ``` -You can use `EmptyLocalStorage` to disable session persistance: +You can use also `EmptyLocalStorage` to disable session persistance: ```dart Supabase.initialize( From 0570af08d205ef96c5d6366d4cefa77fe4dbf6a6 Mon Sep 17 00:00:00 2001 From: Bruno D'Luka <45696119+bdlukaa@users.noreply.github.com> Date: Sun, 21 Aug 2022 13:25:09 -0300 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Tyler <18113850+dshukertjr@users.noreply.github.com> --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bfffc0dc..efd5fe82 100644 --- a/README.md +++ b/README.md @@ -327,7 +327,7 @@ Supabase.instance.client.auth.signInWithProvider( ### Custom LocalStorage -As default, `supabase_flutter` uses [`hive`](https://pub.dev/packages/hive) to persist user session. Encryption is disabled by default, since it's necessary a unique key we can not define. To set an `encryptionKey`, do the following: +As default, `supabase_flutter` uses [`hive`](https://pub.dev/packages/hive) to persist the user session. Encryption is disabled by default, since an unique encryption key is necessary, and we can not define it. To set an `encryptionKey`, do the following: ```dart void main() { @@ -370,7 +370,7 @@ Supabase.initialize( ); ``` -You can use also `EmptyLocalStorage` to disable session persistance: +You can also use `EmptyLocalStorage` to disable session persistance: ```dart Supabase.initialize(