Hi @Neha0408 ,
Thanks for reaching out and apologies for delay in response.
GetAccountsAsync returns all the available accounts in the user token cache for the application.
As mentioned in the code, in the second attempt, you are initiating the "app" variable again and calling GetAccountsAsync() which is running first time after app initialization and nothing in cache.
If your requirement is to instantiate a new app on every action, then it would be recommended to implement serialized token cache.
Hope this will help.
Thanks,
Shweta
---------------------------------------
Please remember to "Accept Answer" if answer helped you.