-
Notifications
You must be signed in to change notification settings - Fork 318
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* send SIGN_OUT signal on sign out event * [REVERT] Publish to @experimental * [Revert] Fix typo * [REVERT] try removing branch restriction * Give provider environment * Remove unused var * Use shared service * Add react example + .feature * Remove unrelated changes * Add angular example * Add vue example * Fix route in .feature * Remove publishing action * Remove unused var * Create fast-fireants-help.md
- Loading branch information
Showing
16 changed files
with
151 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"@aws-amplify/ui-react": patch | ||
"@aws-amplify/ui": patch | ||
"@aws-amplify/ui-vue": patch | ||
"@aws-amplify/ui-angular": patch | ||
--- | ||
|
||
Listen to Auth Hub events |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
examples/angular/src/pages/ui/components/authenticator/hub-events/aws-exports.d.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
examples/angular/src/pages/ui/components/authenticator/hub-events/aws-exports.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import awsExports from '@environments/auth-with-email/src/aws-exports'; | ||
export default awsExports; |
6 changes: 6 additions & 0 deletions
6
examples/angular/src/pages/ui/components/authenticator/hub-events/hub-events.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<amplify-authenticator> | ||
<ng-template amplifySlot="authenticated" let-user="user"> | ||
<h2>Welcome, {{ user.username }}!</h2> | ||
<button (click)="signOut()">Sign Out</button> | ||
</ng-template> | ||
</amplify-authenticator> |
17 changes: 17 additions & 0 deletions
17
examples/angular/src/pages/ui/components/authenticator/hub-events/hub-events.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Component } from '@angular/core'; | ||
import Amplify, { Auth } from 'aws-amplify'; | ||
import awsExports from './aws-exports'; | ||
|
||
@Component({ | ||
selector: 'hub-events', | ||
templateUrl: 'hub-events.component.html', | ||
}) | ||
export class HubEventsComponent { | ||
constructor() { | ||
Amplify.configure(awsExports); | ||
} | ||
|
||
public signOut(): void { | ||
Auth.signOut(); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
examples/next/pages/ui/components/authenticator/hub-events/aws-exports.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import awsExports from '@environments/auth-with-email/src/aws-exports'; | ||
export default awsExports; |
13 changes: 13 additions & 0 deletions
13
examples/next/pages/ui/components/authenticator/hub-events/index.page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Amplify, Auth } from 'aws-amplify'; | ||
|
||
import { withAuthenticator } from '@aws-amplify/ui-react'; | ||
import '@aws-amplify/ui-react/styles.css'; | ||
|
||
import awsExports from './aws-exports'; | ||
Amplify.configure(awsExports); | ||
|
||
function App({}) { | ||
return <button onClick={() => Auth.signOut()}>Sign out</button>; | ||
} | ||
|
||
export default withAuthenticator(App); |
2 changes: 2 additions & 0 deletions
2
examples/vue/src/pages/ui/components/authenticator/hub-events/aws-exports.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import awsExports from '@environments/auth-with-email/src/aws-exports'; | ||
export default awsExports; |
17 changes: 17 additions & 0 deletions
17
examples/vue/src/pages/ui/components/authenticator/hub-events/index.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<script setup lang="ts"> | ||
import Amplify, { Auth } from 'aws-amplify'; | ||
import { Authenticator } from '@aws-amplify/ui-vue'; | ||
import '@aws-amplify/ui-vue/styles.css'; | ||
import aws_exports from './aws-exports'; | ||
Amplify.configure(aws_exports); | ||
</script> | ||
|
||
<template> | ||
<authenticator> | ||
<template v-slot="{ user }"> | ||
<h1>Hello {{ user.username }}!</h1> | ||
<button @click="Auth.signOut()">Sign Out</button> | ||
</template> | ||
</authenticator> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
packages/e2e/features/ui/components/authenticator/hub-events.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Feature: Hub Events | ||
Authenticator listens to external Auth Hub events from 'aws-amplify'. For | ||
example, Authenticator will automatically sign out the user if it gets a | ||
"signOut" hub event. | ||
|
||
Background: | ||
Given I'm running the example "/ui/components/authenticator/hub-events" | ||
|
||
@angular @react @vue | ||
Scenario: Sign in with confirmed credentials then sign out | ||
When I type my "email" with status "CONFIRMED" | ||
And I type my password | ||
And I click the "Sign in" button | ||
Then I see "Sign out" | ||
And I click the "Sign out" button | ||
Then I see "Sign in" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters