This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/initializers/auth-complete.js.es6
2018-06-15 17:03:24 +02:00

16 lines
434 B
JavaScript

export default {
name: "auth-complete",
after: "inject-objects",
initialize() {
if (window.location.search.indexOf("authComplete=true") !== -1) {
const lastAuthResult = localStorage.getItem("lastAuthResult");
localStorage.removeItem("lastAuthResult");
if (lastAuthResult) {
Ember.run.next(() =>
Discourse.authenticationComplete(JSON.parse(lastAuthResult))
);
}
}
}
};