Is it possible to add to Drupal.settings.myModule from hook_user_login? (D7 JWTs)

I’m generating a JWT when a user logs in. That happens in hook_user_login. I want to append that JWT to Drupal.settings.myModule so that the front-end can use it.

hook_page_alter() already passes other user info to Drupal.settings:

function my_module_page_alter(&$page) {
  global $user;

  if ($user->uid) {

    $settings_arr = [
      'myModule' => [
        'userId' => $user->uid,
        'userName' => $user->name,
        'userEmail' => $user->mail,
        'userLastLogin' => $user->login,
        'userLastAccess' => $user->access,
        'userIpAddress' => $user->hostname,
        'userLanguage' => $user->language,
        'userTimezone' => $user->timezone,
      ],
    ];

    $page['header']['#attached']['js'][] = [
      'type' => 'setting',
      'data' => $settings_arr,
    ];

  // ...

Is there a way for me to append the JWT to Drupal.settings.myModule from hook_user_login? Or is there a better way to deal with JSON web tokens in Drupal 7?

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/4/feed