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

Enable username sign in #21

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

Manan-Arora31
Copy link

Description

Added the functionality of username login to aid the users.

Related Issue

Fixes #15 (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Motivation and Context

To improve the feature of user login.

How Has This Been Tested?

It has been tested by running on my local machine

Screenshots (if appropriate):

Checklist:

  • I have registered myself at Contrihub website.
  • My code follows the code style of this project.
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • Any dependent changes have been merged and published in downstream modules
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Test Configuration:

  • Firmware version:
  • Hardware:
  • Toolchain:
  • SDK:

@Manan-Arora31
Copy link
Author

@kunal2812 Sir in the models the username field is set to email . And the model takes nothing else to be considered as username . I tried with firstname but authentication doesn't work with it . I have done rest of the changes in views and html

@kunal2812
Copy link
Collaborator

You have to enable username sign-in. Email signin is already enabled.

@Manan-Arora31
Copy link
Author

@kunal2812 Yes sir, but for that a username field should be there in the model. But there isn't any

@kunal2812
Copy link
Collaborator

@kunal2812 Yes sir, but for that a username field should be there in the model. But there isn't any

That's what you have to do. Add the field.

@Manan-Arora31
Copy link
Author

@kunal2812 Here User can login either using email or firstname. Firstname is used instead of username because username entered by the user in sign up form isn't saved in the model. So, it might confuse the user to ask for username. If they enter that username in sign in form, since no such field is present in the model ( because email is used as username field so another can't be made), the user can't be authenticated.

@kunal2812
Copy link
Collaborator

@kunal2812 Here User can login either using email or firstname. Firstname is used instead of username because username entered by the user in sign up form isn't saved in the model. So, it might confuse the user to ask for username. If they enter that username in sign in form, since no such field is present in the model ( because email is used as username field so another can't be made), the user can't be authenticated.

You have to take the username during the signup and save it to user model. Then after that you have to enable username authentication.
Auth via First Name is senseless since many users can have same First Name

@Manan-Arora31
Copy link
Author

@kunal2812 Sir I have made the changes . Please check .

@kunal2812
Copy link
Collaborator

Have you tested the code? It doesn't seem to be working at all.

@kunal2812 kunal2812 closed this Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable Username and Password Sign-In Option
2 participants