Skip to content
Open
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
8 changes: 3 additions & 5 deletions class-auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ public function get_token( WP_REST_Request $request ) {
$this->send_refresh_token( $user, $request );
}

return $response;
// Let the user modify the data before send it back.
return apply_filters( 'jwt_auth_valid_credential_response', $response, $user );
}

/**
Expand Down Expand Up @@ -280,7 +281,7 @@ public function generate_token( $user, $return_raw = true ) {
}

// The token is signed, now create object with basic info of the user.
$response = array(
return array(
'success' => true,
'statusCode' => 200,
'code' => 'jwt_auth_valid_credential',
Expand All @@ -295,9 +296,6 @@ public function generate_token( $user, $return_raw = true ) {
'displayName' => $user->display_name,
),
);

// Let the user modify the data before send it back.
return apply_filters( 'jwt_auth_valid_credential_response', $response, $user );
}

/**
Expand Down