Search code examples
authenticationamazon-dynamodbamazon-cognitosimultaneous

cognito - limit login to prevent refresh DynamoDb tables


I am building a web app using Vuejs and am using cognito user pools to login. I use ApiGateway and Lambda to access DynamoDb data. I want to limit a user to only be able to log into a single browser window at a time.

My reason is because the user's data is loaded into the app storage once and then all data reads are made from the stored data. if there are any writes then the updated data is downloaded and stored. i want to prevent having to access the database unnecessarily.

If a user can log in to two or more browsers, he can edit data in one browser but the available data in the other browser has not been updated. So to prevent this, I would like to prevent the user from logging in simultaneously in two or more browsers.

Can this be done with cognito?


Solution

  • Currently, there is not out of the box way to do this. However, since you have control over the authorization flow with the use of API-gateway, lambda and DDB you might be able to create this logic inside your lambda function.

    We will consider this feature in our future releases.