feat: Add feature flag for refresh tokens
This commit is contained in:
parent
49780b01fe
commit
c445a6a294
2 changed files with 5 additions and 1 deletions
|
|
@ -57,7 +57,8 @@ enum AppSettings<T> {
|
||||||
displayChatDetailsColumn(
|
displayChatDetailsColumn(
|
||||||
'chat.fluffy.display_chat_details_column',
|
'chat.fluffy.display_chat_details_column',
|
||||||
false,
|
false,
|
||||||
);
|
),
|
||||||
|
enableSoftLogout<bool>('chat.fluffy.enable_soft_logout', false);
|
||||||
|
|
||||||
final String key;
|
final String key;
|
||||||
final T defaultValue;
|
final T defaultValue;
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,7 @@ abstract class ClientManager {
|
||||||
|
|
||||||
static Client createClient(String clientName, SharedPreferences store) {
|
static Client createClient(String clientName, SharedPreferences store) {
|
||||||
final shareKeysWith = AppSettings.shareKeysWith.getItem(store);
|
final shareKeysWith = AppSettings.shareKeysWith.getItem(store);
|
||||||
|
final enableSoftLogout = AppSettings.enableSoftLogout.getItem(store);
|
||||||
|
|
||||||
return Client(
|
return Client(
|
||||||
clientName,
|
clientName,
|
||||||
|
|
@ -130,6 +131,8 @@ abstract class ClientManager {
|
||||||
.singleWhereOrNull((share) => share.name == shareKeysWith) ??
|
.singleWhereOrNull((share) => share.name == shareKeysWith) ??
|
||||||
ShareKeysWith.all,
|
ShareKeysWith.all,
|
||||||
convertLinebreaksInFormatting: false,
|
convertLinebreaksInFormatting: false,
|
||||||
|
onSoftLogout:
|
||||||
|
enableSoftLogout ? (client) => client.refreshAccessToken() : null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue