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]!;
|
||||
ref.read(AuthCodeController.provider.notifier).remove(code);
|
||||
final name = user.userId.getName();
|
||||
|
||||
final jwt = JWT(
|
||||
{
|
||||
"exp":
|
||||
DateTime.now().add(Duration(days: 7)).millisecondsSinceEpoch ~/
|
||||
1000,
|
||||
"name": name,
|
||||
"name": user.userId.getName(),
|
||||
"nonce": user.nonce,
|
||||
"iat": DateTime.now().millisecondsSinceEpoch ~/ 1000,
|
||||
},
|
||||
|
@ -203,12 +202,10 @@ class ApiHelper {
|
|||
),
|
||||
);
|
||||
|
||||
final name = jwt.subject!.getName();
|
||||
|
||||
return Response.ok(
|
||||
json.encode({
|
||||
"active": true,
|
||||
"name": name,
|
||||
"name": jwt.subject!.getName(),
|
||||
}),
|
||||
headers: {"content-type": "application/json"},
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue