aurelia-auth

Aurelia auth - custom response message - console error

旧街凉风 提交于 2019-12-13 00:03:46
问题 Using this aurelia-auth plugin together with .NET Core webAPI, I wish to return a custom error when user tries to log in with incorrect username and/or password. WebAPI: public HttpResponseMessage Login() { if (passwordValid) { return Request.CreateResponse(new LoginResponseViewModel { Token = token }); } else { return Request.CreateResponse(HttpStatusCode.Unauthorized, "Incorrect username or password!"); } } Script logIn(email, password) { return this.auth.login(email, password) .then

Aurelia router not working when resetting root

99封情书 提交于 2019-12-08 09:01:22
问题 I want to use aurelia-auth in my app and also have a login page that is completely separate from the rest of the app. I have been following the tutorial at this link: https://auth0.com/blog/2015/08/05/creating-your-first-aurelia-app-from-authentication-to-calling-an-api/ The problem I am having is after I successfully login and attempt to route to the app, none of the routes are found. I get route not found regardless of what I put in for the login redirect url. Here is my code: app.js: ...