Home Forums Support Can't seem to get the portal working correctly on self-hosted system

This topic contains 4 replies, has 2 voices, and was last updated by  jvantslot 4 weeks ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #20209

    jvantslot
    Participant

    I’m in love with Invoice Ninja! Does everything I need. However, I’m having some difficulty getting the portal to work correctly when accessed through an iFrame on my website.

    I’m sure it’s something I’ve missed, but I can’t seem to figure it out.

    I can access the portal just fine if I visit my sub-domain like so: https://ninja.example.com/client/login

    I’m able to log in as a test client with the client contact’s email and password.

    However, when I try to access the portal from an iFrame on my website: https://www.example.com/portal I get error messages about the credentials not being found.

    I’m using the following code for my iFrame:

    
    <center>
    iframe code here
    </center>
    
    var iframe = document.getElementById('invoiceIFrame');
    var search = window.location.search + '//';
    var silent = search.indexOf('silent') > 0;
    var parts = search.replace('?silent=true', '').split('/');
    iframe.src = 'https://ninja.example.com/' + parts[1] + '/' + parts[0].substring(1, 33) + '/' + parts[2] + (silent ? '?silent=true' : '');
    

    The weird thing is that when I modify the following line:

    iframe.src = 'https://ninja.example.com/' + parts[1] + '/' + parts[0].substring(1, 33) + '/' + parts[2] + (silent ? '?silent=true' : '');

    To be:

    iframe.src = 'https://ninja.example.com/client/login';

    It works!

    My question is, Is this the correct way to do this? Am I making my site vulnerable by doing it this way?

    Any suggestions are welcome.

    Thanks and keep up the great work!

    • This topic was modified 4 weeks ago by  jvantslot. Reason: fixed missing code
    • This topic was modified 4 weeks ago by  jvantslot.
    #20213

    Hillel Coren
    Keymaster

    I don’t believe the client portal login page is supported when using an iframe.

    #20218

    jvantslot
    Participant

    Hmm.. that would be strange then, since I’m cutting and pasting the recommended code directly from the portal settings page.

    Copy the following code to a page on your site.

    #20219

    Hillel Coren
    Keymaster

    The iframe should work with direct invoice links, it just isn’t supported with the client portal login page.

    #20221

    jvantslot
    Participant

    Ahh. Thanks for the clarification. Seems I’ve misunderstood the function of the portal.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

Posted in: