Copied to clipboard

Flag this post as spam?

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


  • Sherlon 13 posts 113 karma points
    May 27, 2019 @ 15:42
    Sherlon
    0

    Umbraco 8 is asking to login again on every refresh - custom section

    I created a custom section in Umbraco 8 CMS. In other words I extended Umbraco 8 CMS with an extra component.

    Everytime I refresh (F5) a page (within my custom section), Umbraco is asking me to login again. What javascript/angular method to use so to avoid this?

    Apparently I need to add some credentials or state in the current session. How to do that?

  • Tarik 196 posts 862 karma points c-trib
    May 27, 2019 @ 17:41
    Tarik
    0

    Sherlon, I suggest to add more details about your goal and what conflict you encounter with Umbraco routing. (screenshots or code)

    Also how it is the credential you need since umbraco have a startup page login and a redirect to a section ?

  • Sherlon 13 posts 113 karma points
    May 28, 2019 @ 07:23
    Sherlon
    0

    Situation

    I created a component for Umbraco 8 CMS. I want to manage some custom data in the database. I add access to the current user to access this component. Everything seems to work fine.

    Problem

    Every time I press the Refresh (F5) button I got redirected to the Login page.

    How to avoid this? i tried with userService.refreshCurrentUser(); but this not working.

  • Tarik 196 posts 862 karma points c-trib
    May 28, 2019 @ 09:29
    Tarik
    0

    Are you calling a function which makes user logged out ?

    What Umbraco service are you calling on the component load ?

  • Sherlon 13 posts 113 karma points
    May 28, 2019 @ 09:32
    Sherlon
    0

    Im calling only this service:

    navService.loadLegacyIFrame(strLocation);
    
  • Tarik 196 posts 862 karma points c-trib
    May 28, 2019 @ 10:20
    Tarik
    0

    Sherlon, I viewed your other post related to this topic and I suggest to review how Umbraco managing application states.

      var url = 'var url = '/backoffice%2fsection%2forder%2findex%2f1%3ftreepath%3dorders';'
    

    ===========

            loadLegacyIFrame: function loadLegacyIFrame(source) {
                $location.path('/' + appState.getSectionState('currentSection') + '/framed/' + encodeURIComponent(source));
            },
    

    i.e the url may become like the following:

    /umbraco#/yourcustomsection/framed/backoffice%2fsection%2forder%2findex%2f1%3ftreepath%3dorders
    
  • Sherlon 13 posts 113 karma points
    May 28, 2019 @ 12:54
    Sherlon
    0

    The url in my browser is exactly like that :-(

    I noticed that the url is not added to the browser history..

  • Sherlon 13 posts 113 karma points
    May 29, 2019 @ 13:21
    Sherlon
    100

    The solution was to encode the url i'm passing:

    encodeURIComponent('backoffice/section/order/index/')
    
  • Tarik 196 posts 862 karma points c-trib
    May 31, 2019 @ 18:01
    Tarik
    0

    Sherlon, I suggest selecting an answer which may simplify searching for the solution post and avoid having many posts without a selected solution.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies