Skip to content

Namerequest UI: Affiliate Name Request with Selected Account for Non-Staff Logins in Namex #26498

Closed

Description

@eve-git

A client may have multiple accounts. The Name Request should be associated with the selected account for non-staff clients as well, ensuring proper affiliation and access control.

For example, in the TEST environment, log in as BCREGA004. This client has multiple accounts. When switching to a different account and creating an NR, the Name Request should be associated with the selected account.

More info/Reference: https://app.zenhub.com/workspaces/entities---olga-65af15f59e89f5043c2911f7/issues/gh/bcgov/entity/25247

refer to https://app.zenhub.com/workspaces/names-team-board-new-655554cbddd49510027dad2e/issues/gh/bcgov/entity/24739 for staff only

Activity

  1. self-assigned this
    on Mar 13, 2025
  2. changed the title [-]Namex: Affiliate Name Request with Selected Account for Non-Staff Logins in Namex[/-] [+]Namerequest UI: Affiliate Name Request with Selected Account for Non-Staff Logins in Namex[/+] on Mar 13, 2025
  3. added
    Names Team
    on Mar 13, 2025
  4. eve-git commented on Mar 13, 2025

    @eve-git
    CollaboratorAuthor

    In test environment, 4 accounts associate with the user BCREGA004:

    select id, user_id, org_id from memberships where user_id = 5; 
    --"id"	"user_id"	"org_id"
    --1267	5	890
    --11	5	8
    --1279	5	912
    --3580	5	2617
    
  5. ozamani9gh commented on Mar 21, 2025

    @ozamani9gh
    Collaborator

    @eve-git when do you think we can get this in TEST so Mihai and entities team can confirm its fixed

  6. self-assigned this
    on Apr 16, 2025
  7. self-assigned this
    on Apr 16, 2025
  8. added
    Entities Team
    on Apr 17, 2025
  9. eve-git commented on Apr 17, 2025

    @eve-git
    CollaboratorAuthor

    There are two issues:
    Steps for the first issue:

    1. in My Business Registry

    2. click "Get Started with a BC Based Business"

    3. try to create a numbered company

    4. click "Incorporate Now"

    5. it shows the page:image.png

    6. select a different account from the account menu, there is an error:image.png

    The second issue is no longer present in TEST, as the code has been rolled back. It occurred when Auth passed an account ID to Name Request, which then attempted to affiliate the account with the new NR. When returning to the business side, the same error reoccurred.

    The likely cause is that the session variable CURRENT_ACCOUNT does not match the account number the NR is affiliated with. Selecting an account does not update the CURRENT_ACCOUNT value in the session. However, Name Request is not supposed to manage CURRENT_ACCOUNT—it should only read it.

  10. severinbeauvais commented on Apr 17, 2025

    @severinbeauvais
    Collaborator
    1. select a different account from the account menu, there is an error:

    I believe this is expected, since the new account isn't affiliated to the subject IA. Users should not change accounts while looking at a business or IA.

    The original issue was that navigating from the BRD while using a non-default account (eg, https://dev.business-registry-dashboard.bcregistry.gov.bc.ca/account/2288) to Namerequest UI didn't retain the account id.

    This still doesn't work: https://dev.names.bcregistry.gov.bc.ca/2288

    But this works: https://dev.names.bcregistry.gov.bc.ca/?accountid=2288

    To fix the above, talk to @JazzarKarim about changing the target URL.

    Meanwhile, changing the account while in Namerequest UI seems to work fine.

  11. 8 remaining items

  12. removed
    Entities Team
    on Jun 5, 2025
  13. self-assigned this
    on Jun 12, 2025
  14. eve-git commented on Jun 13, 2025

    @eve-git
    CollaboratorAuthor

    The sbc-common-components package was updated to reset current_account when the account is switched. However, integration with the latest version caused errors due to incompatible code changes, including—but not limited to—path resolution issues and runtime exceptions:

    1. Module not found: Error: Can't resolve '@/util/constants' in '/root/repos/namerequest/app/node_modules/sbc-common-components/src/components'

    2. ERROR in node_modules/sbc-common-components/src/stores/account.ts:88:39
      TS2339: Property 'response' does not exist on type 'unknown'.
      86 | return userProfile
      87 | } catch (error) {

    88 | console.error('Error: ', error?.response)
    | ^^^^^^^^
    89 | }
    90 | }

    1. ERROR in node_modules/sbc-common-components/src/util/interceptors.ts:7:43
      TS2339: Property 'env' does not exist on type 'ImportMeta'.
      5 | export function addAxiosInterceptors (axiosInstance: AxiosInstance): AxiosInstance {
      6 | axiosInstance.interceptors.request.use(config => {

    7 | const authGatewayApiKey = import.meta.env.VUE_APP_AUTH_API_KEY
    | ^^^
    8 | if (authGatewayApiKey && config.url.includes(ConfigHelper.getAuthAPIUrl())) {
    9 | config.headers['x-apikey'] = authGatewayApiKey
    10 | }

    All of them require code changes in sbc-common-components...

  15. severinbeauvais commented on Jun 16, 2025

    @severinbeauvais
    Collaborator

    @seeker25 ^^ Thoughts? Are there both a Vue version and a Nuxt version of sbc-c-c?

  16. seeker25 commented on Jun 16, 2025

    @seeker25
    Contributor

    These are Typescript errors under node_modules, the newest sbc-common-components is using Pinia too which I don't think your project has. It's using Vuex? Also project is still using vue-cli-service which is dead, should probably migrate that to Vite this seemed to get rid of alot of the typescript errors under the node_modules

  17. ozamani9gh commented on Jun 17, 2025

    @ozamani9gh
    Collaborator

    blocked until Name Request is written in Nuxt/Pinia

  18. severinbeauvais commented on Jun 17, 2025

    @severinbeauvais
    Collaborator

    @OlgaPotiagalova Are you OK with this ticket being deferred? Do you want our team to have a quick look at this, since we have a bit of experience with multiple accounts?

  19. ozamani9gh commented on Jul 24, 2025

    @ozamani9gh
    Collaborator

    @eve-git @EPortman Vikas is hoping we can complete this within August:

    image.png

  20. thorwolpert commented on Jul 27, 2026

    @thorwolpert
    Collaborator

    stale - new issue can be opened if needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    High PriorityName RequestNames Teamblockedconnect

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions