FEATURE: Allow admins to delete user SSO records in the UI (#10669)

Also displays the user's last payload in the admin UI to help with debugging SSO issues.
This commit is contained in:
Penar Musaraj
2020-09-15 10:00:10 -04:00
committed by GitHub
parent 6d7b8a71c0
commit 273db57d6e
10 changed files with 80 additions and 1 deletions

View File

@ -132,6 +132,11 @@ export default Controller.extend(CanCheckEmails, {
.catch(() => bootbox.alert(I18n.t("generic_error")));
},
@discourseComputed("model.single_sign_on_record.last_payload")
ssoPayload(lastPayload) {
return lastPayload.split("&");
},
actions: {
impersonate() {
return this.model.impersonate();
@ -321,5 +326,16 @@ export default Controller.extend(CanCheckEmails, {
resetPrimaryGroup() {
this.set("model.primary_group_id", this.originalPrimaryGroupId);
},
deleteSSORecord() {
return bootbox.confirm(
I18n.t("admin.user.sso.confirm_delete"),
I18n.t("no_value"),
I18n.t("yes_value"),
() => {
return this.model.deleteSSORecord();
}
);
},
},
});