问题
I have setup an implicit account linking page. I tested it with AOG - all good, surface checked, user sent over to the phone app if needed, link worked (status OK, accessToken present).
Now I can't figure out how to reset the user id or the account linking status to repeat this. It's not just testing. The user could need a new token for many other reasons.
Currently if I initiate a subsequent SING_IN it comes back immediately with an OK and the accessToken.
回答1:
If you are using the Implict OAuth Flow, then your Action can revoke the token during webhook fulfillment. Instead of returning a normal response (for example, saying something using the actions-on-google library or by returning JOSN), your webhook should return an HTTP response code of 401. This will force the user to go through the login when next called. Exactly how you do this will depend on the library you're using.
When you're in production, in the listing of Actions users will see that their account has been linked to your Action and can unlink it.
来源:https://stackoverflow.com/questions/51600950/aog-implicit-account-linking-how-to-reset