Page 1 of 1

login in to two appgini applications only once

Posted: 2018-11-08 10:30
by bescott53
hi everyone, i was wondering if anyone else has done this before and can show me how. i have two appgini applications, what i was looking for was someone who was logged into one, could be given a link to go to the other without logging in again separately to the second application? both of them require logins so i cant just leave one open.

Re: login in to two appgini applications only once

Posted: 2018-11-21 13:30
by a.gneady
Are both apps on the same domain name? For example, domain.com/app1 and domain.com/app2? If yes, you should give them the same application name (the application name is the name of the top node in the left tree pane in AppGini, see https://cdn.bigprof.com/screencasts/2018-11-21_1521.png ) ... next, you should have a cronjob (scheduled task) for synchronizing the membership_users and membership_groups tables for both databases (so that they share the same usernames and groups) ... Finally, you probably don't want both apps to display the same title (the title is derived by default from the app name you set in AppGini) ... so you could add code for changing the app name in hooks/footer-extras.php like this:

Code: Select all

<script>
    $j(function() {
        var oldTitle = $j('.navbar-brand').text();
        var oldHTML = $j('.navbar-brand').html();
        // change app name here
        $j('.navbar-brand').html(oldHTML.replace(oldTitle, ' New App Name'));
    })
</script>

Re: login in to two appgini applications only once

Posted: 2018-11-23 11:02
by bescott53
Thanks Ahmad, I will check this and report back to you