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

Unable to restrict access to app without admin approving: all users can view all tasks without being verified #3969

Closed
giordifungula opened this issue Nov 30, 2021 · 2 comments · Fixed by #3788
Assignees
Labels
duplicate This issue or pull request already exists enhancement New feature or request

Comments

@giordifungula
Copy link

What Im currently trying to do.

## I am trying to allow users to be able to view and have access to the app only on approval of the admin verifying the users, because now as long as you have access to the app, you can signup and view each and every detail and information
@ozen @nmanovic

I am using this link to try and fix the issue of disabling self sign up on the login page.

What steps I have done

  • cd into cvat/settings
  • cp base.py base.py.backup
  • open base.py
  • added ACCOUNT_AUTHENTICATION_METHOD = 'username' inside base.py
  • added ACCOUNT_CONFIRM_EMAIL_ON_GET = True inside base.py
  • added ACCOUNT_EMAIL_REQUIRED = True inside base.py
  • added ACCOUNT_EMAIL_VERIFICATION = 'mandatory' inside base.py
  • ran docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f build
  • ran docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f up -d

How am I running CVAT:

  • I have an ec2 instance running version cvat:master branch changes on top of a version that I had running that had the proxy with the nginx server configured in the docker file.
  • When I run commands sudo docker-compose -f docker-compose.yml -f docker-compose.dev.yml build and sudo docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d to build the docker images
  • I'm unable to login as any users after these configs were applied to the base.py file and I build the docker images too.
  • I, however, noticed that there is now a toast saying "You are not verified", if you try and log in as a user that is not verified, but no one is able to login.
  • See screenshots below on what the output is
    Screenshot 2021-11-30 at 19 56 21

Note:

  • It looks like when I reset the default base.py settings and add back the old configs it works fine, however, the problem still persists about users being able to automatically login without being verified by the admin.
  • However, I would like those configs
    added ACCOUNT_AUTHENTICATION_METHOD = 'username' inside base.py
  • added ACCOUNT_CONFIRM_EMAIL_ON_GET = True inside base.py
  • added ACCOUNT_EMAIL_REQUIRED = True inside base.py
  • added ACCOUNT_EMAIL_VERIFICATION = 'mandatory' inside base.py
    to be added to my base.py file but I would like to be able to login as any user and also only be able to login after admin verifies the user.
  • Please let me know if you can replicate this issue or if you can advise on how to get this working whilst still being able to login as any user and keep the latest configs
@nmanovic nmanovic added duplicate This issue or pull request already exists enhancement New feature or request labels Dec 1, 2021
@nmanovic nmanovic self-assigned this Dec 1, 2021
@giordifungula
Copy link
Author

@nmanovic This thread helped me solve the problem:
Essentially, I needed to create the super admin user again and I was able to login now without any issues.
One thing im not sure about that Im considering is probably to just create the super admin user right after I have build the application and made changes, instead of running it twice. Let me know what your thoughts are.
### When exactly am I running the create super user

  • 1st time I am running it is when I am following the documentation on installing cvat
  • now secondly after I hit this error after I made the changes to the base.py file and ran build on the docker images.
    Thank you, please advise, if I can close this or we maybe need to better document when or where you need to create the super admin user especially if you want to restrict access.

@nmanovic
Copy link
Contributor

nmanovic commented Dec 1, 2021

Let's close it. You don't need to create superuser twice. DB is preserved if you don't run docker-compose down -v ... command

@nmanovic nmanovic closed this as completed Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants