I’m trying to use a temporary token to provision Gitlab. I can create a token:
gitlab-rails runner "token = User.find_by_username('root').personal_access_tokens.create(scopes: [:api], name: 'Temp provision token'); token.set_token('****'); token.save!"
How do I delete it later? I don’t want to just revoke it, because later I’m going to recreate it for further provisioning. I’ve tried token.delete and token.destroy, but when I try to create the token again I get a duplicate error suggesting the token is still there:
Key (token_digest)=(****=) already exists