Open Closed

Can we remove you are successfully logout screen and show login screen #3352


User avatar
0
safi created

Hi

I am using 4.4.3 abp version and wanted to remove you are successfully screen and show login screen just after logout currently after logout click it shows you are successfully screen for 1-2 mins and after that it goes to redirect into login screen so Is it possible to remove this screen?

  • ABP Framework version: v4.4.3
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

9 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    You can try this:

    Add to your HttpApi.Host projcet(or IdentityServer).

    [ExposeServices(typeof(LoggedOutModel))]
    public class MyLoggedOutModel : LoggedOutModel
    {
        public override Task<IActionResult> OnGetAsync()
        {
            var url = PostLogoutRedirectUri.Substring(0, PostLogoutRedirectUri.IndexOf("authentication"));
            return Task.FromResult<IActionResult>(Redirect(url.EnsureEndsWith('/') + "authentication/login"));
        }
    
        public virtual Task<IActionResult> OnPostAsync()
        {
            return Task.FromResult<IActionResult>(Page());
        }
    }
    
  • User Avatar
    0
    safi created

    You can try this:

    Add to your HttpApi.Host projcet(or IdentityServer).

    [ExposeServices(typeof(LoggedOutModel))] 
    public class MyLoggedOutModel : LoggedOutModel 
    { 
        public override Task<IActionResult> OnGetAsync() 
        { 
            var url = PostLogoutRedirectUri.Substring(0, PostLogoutRedirectUri.IndexOf("authentication")); 
            return Task.FromResult<IActionResult>(Redirect(url.EnsureEndsWith('/') + "authentication/login")); 
        } 
     
        public virtual Task<IActionResult> OnPostAsync() 
        { 
            return Task.FromResult<IActionResult>(Page()); 
        } 
    } 
    

    Ok thanks for the quick response. Let me try this.

  • User Avatar
    0
    safi created

    You can try this:

    I tried above solution but after that I am getting this page is not working something error after logout click. I have added a new folder with account name inside pages and added this Myloggedoutmodel. cs class.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Can you share a GIF photo? I need to see the execution of the breakpoint. thanks.

  • User Avatar
    0
    safi created

    Hi,

    Can you share a GIF photo? I need to see the execution of the breakpoint. thanks.

    I have putted a breakpoint as well but it's not calling that model

  • User Avatar
    0
    safi created

    Hi,

    Can you share a GIF photo? I need to see the execution of the breakpoint. thanks.

    I am available so if you are available we can check on zoom. I believe you will solve in few mins only.

  • User Avatar
    0
    safi created

    Hi,

    Can you share a GIF photo? I need to see the execution of the breakpoint. thanks.

    Hi

    I can't share Gif photo because it will show my project name as well but we can communicate on mail or zoom to check this. Please let me know when we can check this.

    Thanks,

  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    Try

    public virtual Task<IActionResult> OnGetAsync()
    {
        return Task.FromResult<IActionResult>(Redirect(PostLogoutRedirectUri));
    }
    
  • User Avatar
    0
    safi created

    You can try this:

    Add to your HttpApi.Host projcet(or IdentityServer).

    [ExposeServices(typeof(LoggedOutModel))] 
    public class MyLoggedOutModel : LoggedOutModel 
    { 
        public override Task<IActionResult> OnGetAsync() 
        { 
            var url = PostLogoutRedirectUri.Substring(0, PostLogoutRedirectUri.IndexOf("authentication")); 
            return Task.FromResult<IActionResult>(Redirect(url.EnsureEndsWith('/') + "authentication/login")); 
        } 
     
        public virtual Task<IActionResult> OnPostAsync() 
        { 
            return Task.FromResult<IActionResult>(Page()); 
        } 
    } 
    

    Working perfectly...Thank you so much!

Made with ❤️ on ABP v9.1.0-preview. Updated on November 01, 2024, 05:35