Invalidates the authentication for the current connection.
Example usage
Note: the following example uses the ureq crate with the json feature to first send a request to the database's /signup endpoint which returns a token. The reqwest crate and others can be used here instead.
Alternatively, you could use a command like the following, copy the returned token, and paste it into the .authenticate() method which is used before .invalidate().
As the DEFINE ACCESS method below shows, a token will remain valid by default for 15 minutes.
The output for both println! statements should look like this.
Revoking a refresh token (.refresh(token))
db.invalidate() normally clears the whole session. To revoke only the refresh token carried inside a Token (without invalidating the entire session), call .refresh(token) on the invalidate builder, then await:
Use this when you need to drop refresh capability for a specific token pair while leaving other session state intact.