how to auto generate git PATs?? (personal access tokens)?

I also using JavaScript, vue.js, Wsl , git ssh, and java ( Spring, Spring boot )

enter image description here

i have been trying to get Personal access token ( PATs ) from github.com.

but in the project that i am working on, the token is not permanent.

it just goes away after i have used the token several times.

in github.com it says This token expires on Mon, Jan 10 2022 but i think it has been

invalidated after i used it multiple times even if there is a month left before expiration date.

so i want to regenerate the token after invalidation through Java ( 1.8 ) or JavaScript

please let me know any ways to solve this problem