ContriHUB / Youdemy

Youdemy is an online learning platform that offers a wide range of courses on Computer programming, allowing individuals to acquire new skills and knowledge at their own pace.
0 stars 6 forks source link

Enable username sign in #21

Open Manan-Arora31 opened 10 months ago

Manan-Arora31 commented 10 months ago

Description

Added the functionality of username login to aid the users.

Related Issue

Fixes #15 (issue)

Type of change

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:

Test Configuration:

Manan-Arora31 commented 10 months ago

@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 commented 10 months ago

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

Manan-Arora31 commented 10 months ago

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

kunal2812 commented 10 months ago

@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 commented 10 months ago

@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 commented 10 months ago

@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 commented 10 months ago

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

kunal2812 commented 10 months ago

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