add better return on invalid username / email on registration #28
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
github_actions
go
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set.
Reference: dleven/authfox#28
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently authfox is sending the code 402 (I think) when the registration receives wrong / taken user names and passwords. We should change that to sending 200 (OK) and then doing the verification if the registrations worked in the json payload. When the registration didn't worked we also need to add a small message with the reason. Like "Password must be over 6 characters long".
When a username or email is taken, it returns 500 currently. We should send an info to the front-end instead.
On it!
Also, wdym by "then doing the verification if the registrations worked in the json payload."?
Basically the small function I wrote in the
register.gosource must me moved into the code (or you add the messages as parameters) and when a check fails you need to send200(http.StatusOK) and a json.This is something I coded in the GitHub comment section, so just do something like that. Then you simply send the struct as json via gin:
And that should be it. Thank you really much for looking into this!
Ah. Thank you @MCWertGaming that cleared some stuff up! Thx.