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(
|
||||
'chat.fluffy.display_chat_details_column',
|
||||
false,
|
||||
);
|
||||
),
|
||||
enableSoftLogout<bool>('chat.fluffy.enable_soft_logout', false);
|
||||
|
||||
final String key;
|
||||
final T defaultValue;
|
||||
|
|
|
|||
|
|
@ -102,6 +102,7 @@ abstract class ClientManager {
|
|||
|
||||
static Client createClient(String clientName, SharedPreferences store) {
|
||||
final shareKeysWith = AppSettings.shareKeysWith.getItem(store);
|
||||
final enableSoftLogout = AppSettings.enableSoftLogout.getItem(store);
|
||||
|
||||
return Client(
|
||||
clientName,
|
||||
|
|
@ -130,6 +131,8 @@ abstract class ClientManager {
|
|||
.singleWhereOrNull((share) => share.name == shareKeysWith) ??
|
||||
ShareKeysWith.all,
|
||||
convertLinebreaksInFormatting: false,
|
||||
onSoftLogout:
|
||||
enableSoftLogout ? (client) => client.refreshAccessToken() : null,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue