Replace local user id with person id in JWT payload
This commit is contained in:
parent
6e7957f193
commit
9f2de50b1d
|
@ -11,7 +11,7 @@ part 'accounts_store.g.dart';
|
|||
/// Store that manages all accounts
|
||||
@JsonSerializable()
|
||||
class AccountsStore extends ChangeNotifier {
|
||||
static const prefsKey = 'v2:AccountsStore';
|
||||
static const prefsKey = 'v3:AccountsStore';
|
||||
static final _prefs = SharedPreferences.getInstance();
|
||||
|
||||
/// Map containing JWT tokens of specific users.
|
||||
|
@ -206,7 +206,9 @@ class AccountsStore extends ChangeNotifier {
|
|||
final userData =
|
||||
await lemmy.run(GetSite(auth: token.raw)).then((value) => value.myUser);
|
||||
|
||||
tokens[instanceHost][userData.person.name] = token;
|
||||
tokens[instanceHost][userData.person.name] = token.copyWith(
|
||||
payload: token.payload.copyWith(sub: userData.person.id),
|
||||
);
|
||||
|
||||
await _assignDefaultAccounts();
|
||||
notifyListeners();
|
||||
|
|
|
@ -412,7 +412,7 @@ packages:
|
|||
name: lemmy_api_client
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.13.0"
|
||||
version: "0.14.0"
|
||||
logging:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
@ -44,7 +44,7 @@ dependencies:
|
|||
# utils
|
||||
timeago: ^2.0.27
|
||||
fuzzy: <1.0.0
|
||||
lemmy_api_client: ^0.13.0
|
||||
lemmy_api_client: ^0.14.0
|
||||
intl: ^0.17.0
|
||||
matrix4_transform: ^1.1.7
|
||||
json_annotation: ^4.0.1
|
||||
|
|
Loading…
Reference in New Issue