Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1479 from jrjohnson/transition-to-deprecation
Browse files Browse the repository at this point in the history
Replace deprecated transitionTo method
  • Loading branch information
stopfstedt authored Feb 9, 2024
2 parents 3811512 + 175499a commit 25ddcf2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/routes/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import jwtDecode from '../utils/jwt-decode';
export default class LoginRoute extends Route {
@service serverVariables;
@service session;
@service router;

async model({ token }) {
const tokenData = jwtDecode(token);
Expand All @@ -17,13 +18,13 @@ export default class LoginRoute extends Route {
console.log('Unable to authenticate user');
console.log(tokenData);

this.transitionTo('login-error');
this.router.transitionTo('login-error');
return;
}
this.serverVariables.setApiVariables(apiHost, apiNameSpace);
const jwt = await this.getNewToken(token, apiHost);
await this.session.authenticate('authenticator:ilios-jwt', { jwt });
this.transitionTo('index');
this.router.transitionTo('index');
}

async getNewToken(ltiToken, apiHost) {
Expand Down

0 comments on commit 25ddcf2

Please sign in to comment.