hey there, i am new to auth0, and i am trying to use it for user authentication on my angular App.
after the user logs in or register i still cannot find the user informations as username and email
here is the portion of my call to auth0 to do the login from my app
loginWithRedirect(): void {
this.auth.loginWithRedirect()
}
note the the redirect seems to be working well, and i can also see the user logined from the auth0 dashboard.
Hi @louange,
According to the Angular Quickstart, you can get the logged-in user’s profile like this:
import { Component } from '@angular/core';
import { AuthService } from '@auth0/auth0-angular';
@Component({
selector: 'app-user-profile',
template: `
<ul *ngIf="auth.user$ | async as user">
<li>{{ user.name }}</li>
<li>{{ user.email }}</li>
</ul>`
})
export class UserProfileComponent {
constructor(public auth: AuthService) {}
}
It may be helpful to take a look at an example of this in the Quickstart app: