Auth0 Home Blog Docs

Subscribe to response login

angular-2
login
hosted-login-page

#1

Hi,

I am using angular 4 to build my custom login page, and want to subscribe to response so I can post the errors on front end. Here is function below, please let me know how I can do this.

	public login(email: string, password: string, renew?: boolean): void {
		this.auth0.login({
			realm: 'cosmosdb',
			email,
			password
		}, (err, authResult) => {
			if (err) {
				console.log(err);
				throw new Error(`Error: ${err.error_description}. Check the console for further details.`);
			} else if (authResult && authResult.accessToken && authResult.idToken) {
				this.setSession(authResult, renew);
			}
		});
	}

	this.AS.login(email, password, rememberme).subscribe(){

       }

#2

not sure what you want to do here… Is this an angular question? Is something not working with auth0?


#3

yes it is sir, for it is in typescript code and stated in first paragraph what I want to do?

I want to subscribe to response so I can post errors visible to the user.


#4

I have no experience with angular, so I’ll leave it open to see if anyone else knows how to answer this, but I think you’re better off asking this question on Stack Overflow