the provided account linking tutorials force the skill to restart to get an access token. I would like to keep the session open and add an yes/no interaction to ask the user if linking was successfully. I see that the accessed property
context.System.user.accessToken is not set before restarting the skill. Does anybody know if there is an alternative way to request the token?
I haven’t had this use case yet, but I don’t think it works. I assume the user object is created with every new session.
Here’s an idea. Listen to the AccountLinked skill event and save it (temporarily) in the user’s DB. You should be able to access it from the “old/active” session.
Thanks @AlexSwe sounds like a good idea. For the moment we implemented a good working solution where the user restarts the skill and is routed to the point where he left the setup process.
But I will keep your solution in mind. Probably there will be problems with the database concurrency control which could hide changes by others as long as the session is running. Do you know if this could be the case @AlexSwe ?
I think it is theoretically possible, but very unlikely.