Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add domain to paginatedOnload.js #63

Open
doludizgin opened this issue Oct 16, 2020 · 2 comments
Open

Add domain to paginatedOnload.js #63

doludizgin opened this issue Oct 16, 2020 · 2 comments

Comments

@doludizgin
Copy link

Hi,

How can i add the domain to the userfield like we did before in our 2012 adfs onload.js like this:

if (typeof Login != 'undefined'){
    Login.submitLoginRequest = function () { 
    var u = new InputUtil();
    var e = new LoginErrors();
    var userName = document.getElementById(Login.userNameInput);
    var password = document.getElementById(Login.passwordInput);
    if (userName.value && !userName.value.match('[@\\\\]')) 
    {
        **var userNameValue = 'contoso.com\\' + userName.value;**
        document.forms['loginForm'].UserName.value = userNameValue;
    }

    if (!userName.value) {
       u.setError(userName, e.userNameFormatError);
       return false;
    }

Where should i add this in the code for paginatedonload.js

var usernameInput = document.getElementById("userNameInput");
var passwordInput = document.getElementById('passwordInput');

if ( usernameInput && passwordInput)
{
    var username = document.getElementById('userNameArea');
    var passArea = document.getElementById('passwordArea');
    
    var submitButton = document.getElementById('submitButton');
    var submissionArea = document.getElementById('submissionArea');
    var errorText = document.getElementById('errorText');
    var errorDisplay = document.getElementById('error');
    var workArea = document.getElementById('workArea');
    
    var loginMessage = document.getElementById('loginMessage');
    var originalLoginMessage = "";
    var didLoadPasswordPageBefore = false;
@tjc-jhol
Copy link

tjc-jhol commented Jan 6, 2021

I would like to know this as well.

My guess would be:

var usernameInput = document.getElementById("userNameInput");
var passwordInput = document.getElementById('passwordInput');

if ( usernameInput && passwordInput)
{
    var username = document.getElementById('userNameArea');
    var passArea = document.getElementById('passwordArea');
    
    // Allows the user to not have to specify the domain in the username field.
    if (username.value && !username.value.match('[@\\\\]')) 
    {
        var usernameValue = 'contoso.com\\' + username.value;
        document.forms['loginForm'].username.value = usernameValue;
    }

    var submitButton = document.getElementById('submitButton');
    var submissionArea = document.getElementById('submissionArea');
    var errorText = document.getElementById('errorText');
    var errorDisplay = document.getElementById('error');
    var workArea = document.getElementById('workArea');
    
    var loginMessage = document.getElementById('loginMessage');
    var originalLoginMessage = "";
    var didLoadPasswordPageBefore = false;

@tjc-jhol
Copy link

tjc-jhol commented Jan 6, 2021

Or actually, I think you just add it somewhere in the file relooking at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants