simplify
This commit is contained in:
parent
55bd5b934b
commit
864fcad631
1 changed files with 2 additions and 5 deletions
|
@ -120,14 +120,13 @@ class ApiHelper {
|
||||||
|
|
||||||
final user = codes[code]!;
|
final user = codes[code]!;
|
||||||
ref.read(AuthCodeController.provider.notifier).remove(code);
|
ref.read(AuthCodeController.provider.notifier).remove(code);
|
||||||
final name = user.userId.getName();
|
|
||||||
|
|
||||||
final jwt = JWT(
|
final jwt = JWT(
|
||||||
{
|
{
|
||||||
"exp":
|
"exp":
|
||||||
DateTime.now().add(Duration(days: 7)).millisecondsSinceEpoch ~/
|
DateTime.now().add(Duration(days: 7)).millisecondsSinceEpoch ~/
|
||||||
1000,
|
1000,
|
||||||
"name": name,
|
"name": user.userId.getName(),
|
||||||
"nonce": user.nonce,
|
"nonce": user.nonce,
|
||||||
"iat": DateTime.now().millisecondsSinceEpoch ~/ 1000,
|
"iat": DateTime.now().millisecondsSinceEpoch ~/ 1000,
|
||||||
},
|
},
|
||||||
|
@ -203,12 +202,10 @@ class ApiHelper {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
final name = jwt.subject!.getName();
|
|
||||||
|
|
||||||
return Response.ok(
|
return Response.ok(
|
||||||
json.encode({
|
json.encode({
|
||||||
"active": true,
|
"active": true,
|
||||||
"name": name,
|
"name": jwt.subject!.getName(),
|
||||||
}),
|
}),
|
||||||
headers: {"content-type": "application/json"},
|
headers: {"content-type": "application/json"},
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue