code: def confirm_user(query):
      
      user = _query_to_user(query)
      if click.confirm(f'Are you sure you want to confirm {user!r}?'):
          if security_service.confirm_user(user):
              click.echo(f'Successfully confirmed {user!r} at '
                         f'{user.confirmed_at.strftime("%Y-%m-%d %H:%M:%S%z")}')
              user_manager.save(user, commit=True)
          else:
              click.echo(f'{user!r} has already been confirmed.')
      else:
          click.echo('Cancelled.')
docs: Confirm a user account.