cybertooth-io / ermahgerd-emberjs-cognito

Ember 3+, AWS Cognito OAUTH2 + Amplify all resources pulled from a Rails backend.
0 stars 0 forks source link

Ember-Simple-Auth With AWS Amplify Auth #1

Closed nadnoslen closed 5 years ago

nadnoslen commented 6 years ago

Create an Ember Service & and Authenticator

nadnoslen commented 6 years ago

I've started creating the ember-simple-auth Authenticator and then I abandoned it because it appeared that AWS Amplify Auth did more. After testing and experimenting I've decided that some of the Amplify Auth claims are half truths. For example, I was under the impression that the token would be automatically refreshed around the time of its expiry. That statement is false. More specifically, the access token will be refreshed when you invoke the Auth.currentSession() method. As such, you need a service/mechanism to trigger this refresh like some have done with ember-simple-auth.