Skip to content

Commit

Permalink
Merge pull request #17 from deriv-com/mayuran/helper-update
Browse files Browse the repository at this point in the history
fix: helper class update
  • Loading branch information
ali-hosseini-deriv authored Jun 25, 2024
2 parents 7facb3f + 6a425d2 commit a391789
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/js/footer/helper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,17 @@ window.disableButton = function(button) {
window.enableButton = function(button) {
button.disabled = false;
button.style.opacity = '1';
};
};

window.getOauthUrl = function() {
var fullUrl = window.location.href;
var url = new URL(fullUrl);
var domain = url.hostname;
var validDomains = ['deriv.com', 'deriv.be', 'deriv.me'];

var matchedDomain = validDomains.find(validDomain => domain.endsWith(validDomain));

var oauthUrl = matchedDomain ? `https://oauth.${matchedDomain}` : `https://oauth.deriv.com`;

return oauthUrl;
};

0 comments on commit a391789

Please sign in to comment.