Skip to content

Review/fix signup.go page #6

@devzeeh

Description

@devzeeh

Fix the signup.go for correctness, fields, password length, Database errors.

  • Steps to reproduce
  • User not found or DB error: Error 1146 (42S02): Table 'paycard_playground.persons' doesn't exist
// Check if fields is empty
	if user.Username == "" || user.CardNumber == "" || user.Password == "" {
		h.Tpl.ExecuteTemplate(w, "signup.html", ErrorMessage{Error: "Please check all fields."})
		return
	} 
This should be removed in line 68 - 72
// Get form values using User struct
	user := User{
		Usertype:   "Regular",
		Username:   r.PostFormValue("first_name"),
		Fullname:   r.PostFormValue("first_name") + " " + r.PostFormValue("last_name"),
		CardNumber: r.PostFormValue("card_number"),
		Password:   r.PostFormValue("password"),
		Email:      r.PostFormValue("email"),
		Phone:      r.PostFormValue("contact_number"),
	}
Remove unnecessary variable here that not included in frontend side (HTML)
  • fix overall signup page for clarity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions