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 11 months ago.

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


    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:

    iframe code here
    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 11 months, 1 week ago by  jvantslot. Reason: fixed missing code
    • This topic was modified 11 months, 1 week ago by  jvantslot.

    Hillel Coren

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



    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.


    Hillel Coren

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



    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: