How to delete personal token access from git.lab.com in vs code

Viewed 546

I am first time using the vs code for setting up the git.lab on my Mac laptop. While setting up personal access code to my site. I have enter Code it for git.lab.com (Default site) , can you please guide me where this details gets saved in gitlab and how to delete for it.

2 Answers

On Gitlab go to user preferences (top right corner, preferences), then select Access Tokens in the left nav bar. Or follow this link: https://gitlab.com/-/profile/personal_access_tokens

Search your token under 'Active personal access tokens' and Revoke it.

It is easier with GitLab 15.0 (May 2022):

Revoke a personal access token without PAT ID

In previous versions of GitLab, personal access tokens could be deleted only by the ID.
Because none of the endpoints return an ID from a given value, you couldn’t delete a personal access token if you only had the token value.

You can also now use the personal_access_tokens/self endpoint to revoke a PAT with a single request.
The endpoint revokes the PAT used to make the request, making it easy to quickly revoke PATs in case of a leak.

Thank you Hemanth Krishna for your contribution!

See Documentation and Issue.

Related