I'm using a personal access token to access Github from the command line, in place of a password when prompted for my username and password. If I make a new access token, it works just fine in place of my password the first time, but if I try to use it again, I get this error:
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for <my-repo>
The only way I have been able to use Github from the command line has been to make a new personal access token every single time I need to use a password.
I have tried different expiration dates, but nothing seems to change this behavior. I also have experimented with the new fine-grained tokens, but I need to be able to access private repositories that I do not own (through Github classroom) and as far as I can tell the fine-grained tokens don't allow me to do that without being provided with a token by the admin, which isn't an option for me.
I have the same issue across multiple platforms, so I don't think it has to do with my local environment.
That PAT is being revoked for any reason and you can likely find the answer in the security log.