Skip to content

Attempting to getUser for a migrated user results in UserNotFound exception #299

@stocks29

Description

@stocks29

This is because the sub attribute is not populated in the access token for migrated users, so this lookup fails:

  const user = await userPool.getUserByUsername(ctx, decodedToken.sub);
  if (!user) {
    throw new import_errors.UserNotFoundError();
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions