GitHub Import: Space character after Access Token ignored first, then no check during actual import -> general import error

Summary

If the Personal Access Token by GitHub for GitHub import is entered with an additional space after the token, this space gets ignored in the first step and the GitHub repositories are displayed. If one then tries to import one of these: "An error occurred while importing project" appears an the import fails. The import works if the PAT is entered without the space in the first step, so likely the problem is a missing check for spaces for the actual import process, while listing the repositories checks for spaces.

Steps to reproduce

Enter Personal Access Token from GitHub and add a space at the end. Repositories get listed successfully, then import doesn't work. Entering the same key without space makes everything work. Adding a space in the middle of the Token fails completely.

This happens on local GitLab install and also on GitLab.com (if Access Token is used for import)

What is the current bug behavior?

Import from GitHub not possible with space in token, listing of repositories works though

What is the expected correct behavior?

Listing and import should work, in both processes there should be a check for spaces, or in non. Then the user gets an error right at the start and can look for the space after the token. Now it's just an useless error in the 2nd step (actual import)

Assignee Loading
Time tracking Loading