Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Type hinting #47

Merged
merged 1 commit into from
Oct 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ManageTokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public static function add_user_fields( $fields ) {
$fields['jwtAuthExpiration'] = [
'type' => Types::string(),
'description' => __( 'The expiration for the JWT Token for the user. If not set custom for the user, it will use the default sitewide expiration setting', 'wp-graphql-jwt-authentication' ),
'resolve' => function ( \WP_User $user ) {
'resolve' => function () {
$expiration = Auth::get_token_expiration();

return ! empty( $expiration ) ? $expiration : null;
Expand All @@ -166,7 +166,7 @@ public static function add_user_fields( $fields ) {
$fields['isJwtAuthSecretRevoked'] = [
'type' => Types::non_null( Types::boolean() ),
'description' => __( 'Whether the JWT User secret has been revoked. If the secret has been revoked, auth tokens will not be issued until an admin, or user with proper capabilities re-issues a secret for the user.', 'wp-graphql-jwt-authentication' ),
'resolve' => function ( \WP_User $user ) {
'resolve' => function ( User $user ) {
$revoked = Auth::is_jwt_secret_revoked( $user->ID );

return true == $revoked ? true : false;
Expand Down