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

Fix Bug 4010 - API method to register does not return authentification token #4092

Merged
merged 12 commits into from
Jan 17, 2022

Conversation

g-kartik
Copy link
Contributor

@g-kartik g-kartik commented Dec 29, 2021

Motivation and context

fixes #4010

When email verification is turned off in the all-auth settings, the rest-register api does not return auth-token key. This pull request solves the issue by returning the key in this condition.
Changes:

  • Modify get_response_data of RegisterViewEx in iam views to add a new response field 'key'
  • The value of key will depend on the email verification setting of all-auth. If email verification is 'none', its value will be request user's auth token key else it will be 'None'.

How has this been tested?

Tests

  • Created tests for 'rest_register' api located in cvat/iam/tests/test_rest_apis.py to verify its response, both in case of email verification being turned on and turned off.
  • From the root directory ran python manage.py test cvat.apps.iam.tests to run the tests

Checklist

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.
  • I have updated the license header for each file (see an example below)
# Copyright (C) 2021 Intel Corporation
#
# SPDX-License-Identifier: MIT

@g-kartik g-kartik changed the title Bug 4010 Fix Bug 4010 - API method to register does not return authentification token Dec 29, 2021
@bsekachev
Copy link
Member

Hi, @g-kartik

Thank your for the contribution!
Please expect delay in review because of New Year coming, and have a nice New Year celebration!

@g-kartik
Copy link
Contributor Author

Hi, @g-kartik

Thank your for the contribution!
Please expect delay in review because of New Year coming, and have a nice New Year celebration!

Okay, Thank you!

Split the test case for user registration without email verification into two test cases by overriding ACCOUNT_EMAIL_VERIFICATION
as 'none' and 'optional'
@azhavoro azhavoro self-assigned this Jan 10, 2022
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

@nmanovic nmanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the contribution!

@nmanovic nmanovic merged commit 566eb2a into cvat-ai:develop Jan 17, 2022
@nmanovic nmanovic mentioned this pull request Mar 4, 2022
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API method to register does not return authentification token
4 participants