Skip to content

Commit

Permalink
NAS-128632 / 13.3 / Fixing oauth forms (#10109)
Browse files Browse the repository at this point in the history
  • Loading branch information
undsoft authored May 27, 2024
1 parent abe240b commit 4c3404a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ export class FormOauthLoginComponent implements Field {
}

doAuth(message: OauthJiraMessage): void {
if (message.origin !== 'https://www.truenas.com') {
return;
}
const token = message.data as string;
this.group.controls[this.config.name].setValue(token);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1245,6 +1245,9 @@ export class CloudCredentialsFormComponent {
window.addEventListener('message', doAuth, false);

function doAuth(message) {
if (message.origin !== 'https://www.truenas.com') {
return;
}
window.removeEventListener('message', doAuth);
if (message.data.oauth_portal) {
if (message.data.error) {
Expand Down
3 changes: 3 additions & 0 deletions src/app/pages/system/email/email.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@ export class EmailComponent implements OnDestroy {
window.addEventListener('message', doAuth, false);

function doAuth(message) {
if (message.origin !== 'https://www.truenas.com') {
return;
}
if (message.data.oauth_portal) {
if (message.data.error) {
dialogService.errorReport(T('Error'), message.data.error);
Expand Down

0 comments on commit 4c3404a

Please sign in to comment.