Comments (10)
After some googling (quite hidden, so that unfortunately I lost the link and I can't cite) I went with the following solution of changing the 'original hack' of
this.cdRef.detectChanges()
in the onAuthUIStateChange handling, as stated in the official Angular Amplify docu, towards
this.ngZone.run(() => this.cdRef.detectChanges());
after adding the ngZone reference to the constructor.
Of course, this seems to be an even stronger hack than the original one, but at least it works now.
from amplify-ui.
Hello, sorry about the silence here -- we have released @aws-amplify/[email protected]
which adheres to Angular best principles than the previous web component version. Please see
- https://ui.docs.amplify.aws/getting-started/installation?platform=angular
- https://ui.docs.amplify.aws/components/authenticator?platform=react#quick-start
to get started, thanks 🙏
from amplify-ui.
Same for me, unfortunately. Is there some update or does anyone have a smart workaround idea?
What I finally did is to log-in, log-out, etc. manually and create my own components.
from amplify-ui.
Also seeing the same issue. Thanks for raising.
from amplify-ui.
Is there some update about this issue?
from amplify-ui.
Same for me, unfortunately. Is there some update or does anyone have a smart workaround idea?
from amplify-ui.
I had to deal with my own components too!
from amplify-ui.
@rawinkler Thank you so much , I don't know about ngZone or detectChanges but this worked.
Actually
I wanted to call my server api (Lets say getMyUsername) that resolves cognito id to username in my server's database
Then load the component which we wrap like
<amplify-authenticator *ngIf="authState !== 'signedin'"></amplify-authenticator>
<div *ngIf="authState === 'signedin' && user" class="App">
<amplify-sign-out></amplify-sign-out>
<!-- This is where you application template code goes -->
<my-next-component><my-next-component>
</div>
Because I am not using auth guard, I was wondering how to wait for getMyUsername to finish and pass the username to my-next-component, I have this in app.component.html
so, in onAuthUIStateChange, I needed some wait to finish for getMyUsername before moving to my-next-component
To solve this, I subscribed to getMyUsername and set load:boolean = true;
and added load in following div in app.html
<amplify-authenticator *ngIf="authState !== 'signedin'"></amplify-authenticator>
<div *ngIf="load && authState === 'signedin' && user" class="App">
<amplify-sign-out></amplify-sign-out>
<!-- This is where you application template code goes -->
<my-next-component><my-next-component>
</div>
Let me know how can we achieve something that I wanted to do in better way, because I think this is not the way, Right?
How can I get the control when signin or signup of ui component is clicked and what happens after that , where is code of it and how to customize it for my use-case.
Thanks community , you're always there. UNITY IS PERFECT
from amplify-ui.
I was never able to even get the ngOnDestroy() to be hit once the ngIf
kicked in - so I just ended up using the Hub to listen for auth events: https://docs.amplify.aws/guides/authentication/listening-for-auth-events/q/platform/js/
import { Hub } from 'aws-amplify';
Hub.listen('auth', (data) => {
switch (data.payload.event) {
case 'signIn':
console.log('user signed in');
break;
case 'signUp':
console.log('user signed up');
break;
case 'signOut':
console.log('user signed out');
break;
case 'signIn_failure':
console.log('user sign in failed');
break;
case 'configured':
console.log('the Auth module is configured');
}
});
from amplify-ui.
@wlee221 I have spent time looking at the documentation at the link provided above for angular but unable to determine how I can call a method after a successful login.
Is there a sample app of angular which is available?
from amplify-ui.
Related Issues (20)
- Customizable Visual Feedback Colors in Liveness Component HOT 3
- Autocomplete footer not allowing onClick HOT 2
- [Face Liveness] Cannot complete check due to server issue. Try again HOT 13
- Authenticator with only social sign in (hide regular sign in fields) HOT 2
- React: Set unique id to each authenticator step's button HOT 3
- Unrecognizable lambda output - When user Create an account HOT 1
- [i18n] update dictionaries/authenticator/kr.ts HOT 1
- Geo: Marker "TypeError: Cannot destructure property 'map' of '(0 , import_react4.useContext)(...)' as it is null." HOT 5
- bug(react/Menu): Hitting enter on MenuButton does not trigger the menu to open
- The SignUp UI does not render few fields sometimes HOT 9
- WebSocket connection failed HOT 4
- bug(StorageManager/a11y): Upload status is not announced to screen readers
- SERVER_ERROR: Signature expired: 20240614T145057Z is now earlier than 20240614T154633Z HOT 1
- Allow further customization of Amplify
- onFileRemove does not receive updated key from processFile in StorageManager
- [FR] provide file to StorageManager event callbacks
- Wrong error message validation on "Email verification" when signin HOT 1
- Amplify Studio tutorial feedback HOT 2
- Make the loading screen or that rainbow color customizable HOT 2
- Cannot get accessToken within Authenticator element
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amplify-ui.