pmill / aws-cognito

A PHP library for AWS Cognito user pools
MIT License
74 stars 62 forks source link

Logout functionality #4

Closed engharb closed 6 years ago

engharb commented 6 years ago

Hello,

How can I implement Logout function? and isAuthenticated function?

regards,

pmill commented 6 years ago

Hello, for isAuthenticated functionality you can use the verifyAccessToken method.

The only logout method aws cognito api offers are the GlobalSignOut methods, however this signs the user out of all active sessions rather than just the current one, so it's probably not what you are looking for. However you can simply just 'forget' the authentication tokens you have in your app and require the user to login again to get new ones.