Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot register as LAST_RESORT_SUPERADMIN_EMAIL #2165

Open
palisadoes opened this issue Apr 6, 2024 · 14 comments
Open

Cannot register as LAST_RESORT_SUPERADMIN_EMAIL #2165

palisadoes opened this issue Apr 6, 2024 · 14 comments
Labels
bug Something isn't working no-issue-activity No issue activity unapproved Unapproved for Pull Request

Comments

@palisadoes
Copy link
Contributor

Describe the bug

You cannot register using the LAST_RESORT_SUPERADMIN_EMAIL email address

To Reproduce
Steps to reproduce the behavior:

  1. Use the latest API and Admin develop code
  2. Run the API setup
    1. Set the LAST_RESORT_SUPERADMIN_EMAIL
    2. Install the sample data database
  3. Start the API and Admin
  4. You cannot register using the LAST_RESORT_SUPERADMIN_EMAIL email address

Expected behavior
A clear and concise description of what you expected to happen.

Actual behavior

API Logs

[0] error 2024-04-06 08:14:26 k31ed6d2cg Field "UserInput.selectedOrganization" of required type "ID!" was not provided. {"locations":[{"line":3,"column":11}],"extensions":{"code":"GRAPHQL_VALIDATION_FAILED","stacktrace":["GraphQLError: Field \"UserInput.selectedOrganization\" of required type \"ID!\" was not provided.","    at Object.ObjectValue (/home/peter/code/GitHub/PalisadoesFoundation/talawa-api/node_modules/graphql/validation/rules/ValuesOfCorrectTypeRule.js:64:13)","    at Object.enter (/home/peter/code/GitHub/PalisadoesFoundation/talawa-api/node_modules/graphql/language/visitor.js:301:32)","    at Object.enter (/home/peter/code/GitHub/PalisadoesFoundation/talawa-api/node_modules/graphql/utilities/TypeInfo.js:391:27)","    at visit (/home/peter/code/GitHub/PalisadoesFoundation/talawa-api/node_modules/graphql/language/visitor.js:197:21)","    at validate (/home/peter/code/GitHub/PalisadoesFoundation/talawa-api/node_modules/graphql/validation/validate.js:91:24)","    at processGraphQLRequest (/home/peter/code/GitHub/PalisadoesFoundation/talawa-api/node_modules/@apollo/server/src/requestPipeline.ts:247:40)","    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","    at internalExecuteOperation (/home/peter/code/GitHub/PalisadoesFoundation/talawa-api/node_modules/@apollo/server/src/ApolloServer.ts:1313:12)","    at runHttpQuery (/home/peter/code/GitHub/PalisadoesFoundation/talawa-api/node_modules/@apollo/server/src/runHttpQuery.ts:232:27)","    at runPotentiallyBatchedHttpQuery (/home/peter/code/GitHub/PalisadoesFoundation/talawa-api/node_modules/@apollo/server/src/httpBatching.ts:85:12)","    at ApolloServer.executeHTTPGraphQLRequest (/home/peter/code/GitHub/PalisadoesFoundation/talawa-api/node_modules/@apollo/server/src/ApolloServer.ts:1087:14)"]}} 
[0] info 2024-04-06 08:14:26 k31ed6d2cg ::1 - - [06/Apr/2024:15:14:26 +0000] "POST /graphql/ HTTP/1.1" 400 158 9.270 ms  

Screenshots

image

Additional details

This may be related to:

  1. Admin - Select organization on registration talawa-admin#1440
  2. made selection of organization while sign up #2143

Potential internship candidates

@palisadoes palisadoes added the bug Something isn't working label Apr 6, 2024
@github-actions github-actions bot added the unapproved Unapproved for Pull Request label Apr 6, 2024
@adi790uu
Copy link
Contributor

adi790uu commented Apr 6, 2024

@palisadoes would like to solve this.

@palisadoes
Copy link
Contributor Author

Please write a test to make sure the LAST_RESORT_SUPERADMIN_EMAIL can always register. This was supposed to have been fixed before, but now it's broken.

These are possibly related issues.

  1. [userTypeFix] Failure to Create User in appUser Table Using LAST_RESORT_SUPERADMIN_EMAIL Leads to Empty Organization List #2048
  2. [userTypeFix]: Organizations not Visible Error talawa-admin#1768

@adi790uu
Copy link
Contributor

Working on this.

@adi790uu
Copy link
Contributor

  1. @palisadoes got the exact issue but need some help there is a selectedOrganization argument which the signup api mutation is using which is not being passed from the frontend I would like to know what is the exact use of this argument in this mutation.

  2. From the code it looks like it is making the user join an organization or create a membership request.

@adi790uu
Copy link
Contributor

but a superAdmin does not require joining any organization, I have to separate the login for superAdmin

@palisadoes
Copy link
Contributor Author

  1. We are now requiring people to select an organization when they register. This will help to ensure that the Mobile and User portal users can access a default newsfeed on login. This is implemented in mobile, but not yet in the User portal
  2. One of the latest Admin PRs uses a registration dropdown to implement this
    1. [ Feature ] Select Organization on the Registration screen talawa-admin#1904
  3. One approach would be for the SuperAdmin of last resort to registers with one of the organizations as normal, then you update the DB schema to undo the relationship afterwards. Would that make sense?

@adi790uu
Copy link
Contributor

@palisadoes Do you mean that whatever the SuperAdmin of last resort selects it doesn't matter we would register him/her as an Admin for all the organizations?

@palisadoes
Copy link
Contributor Author

After some thought we should make the LAST_RESORT_SUPERADMIN_EMAIL user select an organization on registration and we add them to just that organization in adminFor, but also set isSuperAdmin.

Is this how we handle an Admin or member being promoted to SuperAdmin currently? Or do we reset adminFor, but also set isSuperAdmin?

Copy link

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

@github-actions github-actions bot added the no-issue-activity No issue activity label Apr 27, 2024
@Huy1996
Copy link

Huy1996 commented May 4, 2024

@adi790uu Are you still working on this?

@github-actions github-actions bot removed the no-issue-activity No issue activity label May 5, 2024
@adi790uu
Copy link
Contributor

adi790uu commented May 5, 2024

Yeah I was busy so couldn't get to this but will finish this as soon as possible.

Copy link

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

@github-actions github-actions bot added the no-issue-activity No issue activity label May 16, 2024
@palisadoes
Copy link
Contributor Author

Unassigning. Inactivity

@github-actions github-actions bot removed the no-issue-activity No issue activity label May 17, 2024
Copy link

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

@github-actions github-actions bot added the no-issue-activity No issue activity label May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working no-issue-activity No issue activity unapproved Unapproved for Pull Request
Projects
None yet
Development

No branches or pull requests

3 participants