FR (Authenticator): Support global sign-out
Is your feature request related to a problem? Please describe.
UI components don't allow for passing in arguments to the Auth.signIn and Auth.signOut calls:
- https://docs.amplify.aws/lib/auth/emailpassword/q/platform/js#sign-up
- https://docs.amplify.aws/lib/auth/emailpassword/q/platform/js#sign-in
- https://docs.amplify.aws/lib/auth/emailpassword/q/platform/js#global-sign-out
Describe the solution you'd like
Investigate declarative solutions, similar to https://github.com/aws-amplify/amplify-js/pull/5443 & https://github.com/aws-amplify/amplify-js/pull/4185:
<amplify-sign-out global />
Describe alternatives you've considered
Calling Auth.signOut({ global: true }), but it's not declarative.
Additional context
If https://github.com/aws-amplify/amplify-js/pull/4185 is merged, then @aws-amplify/ui-angular lacks parity.
@ericclemmons
I tried to use Auth.signOut({ global: true }) for a linked google account logout but I got this error from https://cognito-idp.us-east-1.amazonaws.com/ request.
Access Token does not have required scopes

Could you tell me how to set up the scope for this?
This is what I have in my Cognito app client settings

It is not mentioned in the these documents https://docs.amplify.aws/lib/auth/emailpassword/q/platform/js#re-send-confirmation-code https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-app-idp-settings.html
Since we provide a signOut() method in @next, this method should support passing options:
<button onClick={() => signOut({ global: true })>Sign Out</button>
which gets passed to:
services: {
signOut(context, event) {
Auth.signOut(event.data);
}
}
Turns out this is harder to do than anticipated because the signOut actor only receives an xstate.init event, not the actual data from sendToMachine('SIGN_OUT').
De-scoping from the GA release so that we can investigate the following:
- Remove
signOutactor in favor of simplerinvokeflow. - Ensure
signOutroutestill exists and is returned for headless usage.
Need me to pick this one up? ;)