-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove ember-ajax and use ember-fetch
- Loading branch information
Showing
91 changed files
with
1,320 additions
and
798 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,34 @@ | ||
import ENV from 'irene/config/environment'; | ||
import BaseAuthenticator, { LoginSuccessDataProps, processData } from './base'; | ||
import type { AjaxError } from 'irene/services/ajax'; | ||
|
||
export default class Saml2Auth extends BaseAuthenticator { | ||
authenticate(ssotoken: string) { | ||
return new Promise((resolve, reject) => { | ||
const url = ENV['endpoints']['saml2Login']; | ||
const url = ENV['endpoints']['saml2Login'] as string; | ||
|
||
this.ajax.post(url, { data: { token: ssotoken } }).then( | ||
(data: LoginSuccessDataProps) => { | ||
this.restoreLastTransition(data.user_id); | ||
this.ajax | ||
.post<LoginSuccessDataProps>(url, { data: { token: ssotoken } }) | ||
.then( | ||
(data) => { | ||
this.restoreLastTransition(data.user_id); | ||
|
||
data = processData(data); | ||
resolve(data); | ||
}, | ||
(error: AjaxError) => { | ||
let msg = 'Login failed'; | ||
data = processData(data); | ||
resolve(data); | ||
}, | ||
(error: AjaxError) => { | ||
let msg = 'Login failed'; | ||
|
||
if (error.payload.message) { | ||
msg = 'Login failed: ' + error.payload.message; | ||
} | ||
if (error.payload.message) { | ||
msg = 'Login failed: ' + error.payload.message; | ||
} | ||
|
||
this.notify.error(msg); | ||
this.router.transitionTo('login'); | ||
this.notify.error(msg); | ||
this.router.transitionTo('login'); | ||
|
||
return reject(msg); | ||
} | ||
); | ||
return reject(msg); | ||
} | ||
); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.