Starts in:
1 DAY
1 HR
36 MIN
25 SEC
Starts in:
1 D
1 H
36 M
25 S
Open Closed

Setting the value of the new custom property of the identity user giving the error #5581


User avatar
0
hardip created
  • ABP Framework version: v7.1.0
  • UI Type: Blazor Server
  • Database System: EF Core (PostgreSQL)
  • Tiered (for MVC): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

I want to restrict user to login from one browser-device at a time, referred this : https://support.abp.io/QA/Questions/536/How-to-Restrict-users-multiple-login-session

Added new property in the identity user table. In the login post method getting the value of the new property correct, but when I set the value of it getting the error.

Also can not set the value of the property in the logout as well.

refer login method :

refer logout method :

refer for error when logging in :


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

    Please make sure the RabbitMQ Server is available.

  • User Avatar
    0
    hardip created

    In the project we do not use the RabbitMQ server, it is added by default by ABP.

    After removing "AbpEventBusRabbitMqModule" from two modules the error is resolved.

    Questions :

    1. Since our project does not use "AbpEventBusRabbitMqModule" but does it being used in any abp feature causing it to break the any feature?
    2. Right now checking the IdentityUser Custom field value to allow login and then changing it's value, and then at the logout from blazor and account side changing it's value. So Do I need to make any more changes to implement this one device login feature?
    3. How to change the value of the custom field when token is invalidated?
    4. If I want to restrict user to login from one browser in single device, if they change the device then they can login. How to implement this feature?
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Since our project does not use "AbpEventBusRabbitMqModule" but does it being used in any abp feature causing it to break the any feature?

    Distributed Event bus system allows to publish and subscribe to events that can be transferred across application/service boundaries. You can use the distributed event bus to asynchronously send and receive messages between microservices or applications.

    https://docs.abp.io/en/abp/latest/Distributed-Event-Bus

    If you don't need to post messages between applications, then you can delete it.

    Right now checking the IdentityUser Custom field value to allow login and then changing it's value, and then at the logout from blazor and account side changing it's value. So Do I need to make any more changes to implement this one device login feature? How to change the value of the custom field when token is invalidated? If I want to restrict user to login from one browser in single device, if they change the device then they can login. How to implement this feature?

    I don't understand why you want to change the value after logging out.

    You can verify the access_token in the Blazor application and log out example: https://github.com/abpframework/abp/blob/6eb1d1a809e6bc840348a783e4f24c5721345920/framework/src/Volo.Abp.AspNetCore.Components.Server/Microsoft/AspNetCore/Authentication/Cookies/CookieAuthenticationOptionsExtensions.cs#L19 https://github.com/abpframework/abp/blob/6eb1d1a809e6bc840348a783e4f24c5721345920/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyProjectNameBlazorModule.cs#L167

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06