Skip to content

Commit

Permalink
Return token expiry in milliseconds
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesedmonston committed Dec 10, 2020
1 parent a9756f2 commit b159a53
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/gql/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public static function getType(): Type
$fields['accessToken'] = Type::nonNull(Type::string());
} else {
$fields['jwt'] = Type::nonNull(Type::string());
$fields['jwtExpiresAt'] = Type::nonNull(Type::int());
$fields['jwtExpiresAt'] = Type::nonNull(Type::float());
$fields['refreshToken'] = Type::nonNull(Type::string());
$fields['refreshTokenExpiresAt'] = Type::nonNull(Type::int());
$fields['refreshTokenExpiresAt'] = Type::nonNull(Type::float());
}

return GqlEntityRegistry::createEntity(static::getName(), new ObjectType([
Expand Down
4 changes: 2 additions & 2 deletions src/gql/JWT.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ public static function getType(): Type

$fields = [
'jwt' => Type::nonNull(Type::string()),
'jwtExpiresAt' => Type::nonNull(Type::int()),
'jwtExpiresAt' => Type::nonNull(Type::float()),
'refreshToken' => Type::nonNull(Type::string()),
'refreshTokenExpiresAt' => Type::nonNull(Type::int()),
'refreshTokenExpiresAt' => Type::nonNull(Type::float()),
];

return GqlEntityRegistry::createEntity(static::class, new ObjectType([
Expand Down
4 changes: 2 additions & 2 deletions src/services/TokenService.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,9 @@ public function create(User $user, Int $schemaId)

return [
'jwt' => $jwt->toString(),
'jwtExpiresAt' => $jwtExpiration->getTimestamp(),
'jwtExpiresAt' => $jwtExpiration->getTimestamp() * 1000,
'refreshToken' => $refreshToken,
'refreshTokenExpiresAt' => $refreshTokenExpiration->getTimestamp(),
'refreshTokenExpiresAt' => $refreshTokenExpiration->getTimestamp() * 1000,
];
}

Expand Down

0 comments on commit b159a53

Please sign in to comment.