Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Neil Gaietto 13 posts 72 karma points c-trib
    Jun 16, 2014 @ 16:44
    Neil Gaietto
    0

    Extending Login Screen

    Is it possible to extend or switch out the login screen in umbraco 7?

    I am adding a reset password feature to the login screen, but I dont want to work directly in the umbraco files to avoid upgrade issues.

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Jun 19, 2014 @ 19:34
    Matt Brailsford
    0

    Hi Neil,

    I've done something similar recently, adding a LaunchKey login option to the login screen and faced the same issue. Not wanting to modify the core files, the best way I came up with was to register an interceptor on the $httpProvider and have it redirect any requests for the login.html file to my custom login page (basically a duplication of the core one but with my custom markup in there too).

    angular.module('umbraco.services').config([
        '$httpProvider',
        function ($httpProvider) {
    
            $httpProvider.interceptors.push(function ($q) {
                return {
                    'request': function (config) {
    
                        // Redirect any requests to the login dialog to our custom dialog
                        if (config.url == "views/common/dialogs/login.html")
                            config.url = '/App_Plugins/LaunchKey/Views/launchKey.LoginDialog.html';
    
                        return config || $q.when(config);
    
                    }
                };
            });
    
        }]);
    

    Depending on how you intend to incorporate the feature, if you just want to insert a link to a seperate page to do the reset password, you should be able add the link to your custom markup and just reuse the in built controller for the login page. If you want to do it inline however, you will likely need to duplicate / alter the controller class too and have your new custom view use that controller instead.

    Anyways, this should give you something to chew on for the mean time though :)

    Many thanks

    Matt

Please Sign in or register to post replies

Write your reply to:

Draft