-
Notifications
You must be signed in to change notification settings - Fork 699
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
Add string prompt to log in with existing username or create an account #12310
Add string prompt to log in with existing username or create an account #12310
Conversation
Build Artifacts
|
kolibri/plugins/setup_wizard/assets/src/views/onboarding-forms/UserCredentialsForm.vue
Outdated
Show resolved
Hide resolved
…is360/kolibri into username-exists-string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of string things I noticed - looks like the redirect has been updated to go via the wizard state, which seems important per the above!
kolibri/plugins/setup_wizard/assets/src/views/onboarding-forms/UserCredentialsForm.vue
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! =D
Just a little non blocker question 👐.
Looks like all code changes are approved - so @pcenov and @radinamatic take it away! |
Hi @LianaHarris360 for some reason I am always getting the following error in the console when attempting to create a new user regardless of whether that user already exists or doesn't exist: SyntaxError: Unexpected token '<', " <!DOCTYPE "... is not valid JSON And the following request response: 2024-07-01_16-35-52.mp4Logs: |
My guess here is that the csrf_exempt decorator and the csrf_protect decorator are not quite working properly together: https://github.com/learningequality/kolibri/blob/develop/kolibri/core/auth/api.py#L807 To fix this, I would suggest we tweak the inheritance slightly - to something like this:
That should ensure that the public sign up viewset is definitely not CSRF protected. |
Hi @pcenov could you check to see if you are still experiencing that error? |
Hi @LianaHarris360 - yes, I'm still getting the same error. |
@pcenov were you testing with the asset from this PR for both sides of the learner creation? I tested with the asset from this PR for both the LOD that was creating a user and the server it was creating it on, and I had no issues. The fix I suggested @LianaHarris360 apply here was needed on the server side, rather than locally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, I have manually confirmed the behaviour, and the regression that @pcenov had noted is not extant when both Kolibris are running the updated asset.
Yeah, I was using the asset from this PR on both sides but as I was in a hurry might have tried to create the user on one of the other servers that I was running... Anyways - after carefully checking today I confirm that this is fixed indeed, thanks @LianaHarris360! |
Summary
This pull request introduces the necessary string to prompt user to sign in, which improves the user interface when inputting an existing username.
Added String:
Sign in instead?
SignInInstead.mp4
Note:
This pull request introduces changes to the component UserCredentialsForm which is used within the components SelectSuperAdminAccountForm and LodJoinFacility.
However these changes are only necessary for LodJoinFacility. The Sign in instead? link only displays if
errorsCaught
includes the errorUSERNAME_ALREADY_EXISTS
, which is set in the component LodJoinFacility but does not get set in SelectSuperAdminAccountForm.References
Closes #11882
Reviewer guidance
Testing checklist
PR process
Reviewer checklist
yarn
andpip
)