use status ok on incorrect password
This commit is contained in:
1 parent
7573ebcdf4
commit
6bb2607420
3 files changed
+8
-8
No files matched your search
@@ -566,7 +566,7 @@ func StudentLogin(c *fiber.Ctx) error {
|
||||
"error": updateErr,
|
||||
})
|
||||
}
|
||||
return c.Status(fiber.StatusUnauthorized).JSON(fiber.Map{
|
||||
return c.Status(fiber.StatusOK).JSON(fiber.Map{
|
||||
"success": false,
|
||||
"message": "incorrect password",
|
||||
})
|
||||
@@ -637,7 +637,7 @@ func TeacherLogin(c *fiber.Ctx) error {
|
||||
|
||||
var verified bool = teacher.ComparePasswords(data["password"])
|
||||
if verified == false {
|
||||
return c.Status(fiber.StatusUnauthorized).JSON(fiber.Map{
|
||||
return c.Status(fiber.StatusOK).JSON(fiber.Map{
|
||||
"success": false,
|
||||
"message": "incorrect password",
|
||||
})
|
||||
@@ -707,7 +707,7 @@ func AdminLogin(c *fiber.Ctx) error {
|
||||
|
||||
var verified bool = admin.ComparePasswords(data["password"])
|
||||
if verified == false {
|
||||
return c.Status(fiber.StatusUnauthorized).JSON(fiber.Map{
|
||||
return c.Status(fiber.StatusOK).JSON(fiber.Map{
|
||||
"success": false,
|
||||
"message": "incorrect password",
|
||||
})
|
||||
|
||||
@@ -290,7 +290,7 @@ func UpdateStudentPassword(c *fiber.Ctx) error {
|
||||
|
||||
if !student.ComparePasswords(data["password"]) {
|
||||
cancel()
|
||||
return c.Status(fiber.StatusUnauthorized).JSON(fiber.Map{
|
||||
return c.Status(fiber.StatusOK).JSON(fiber.Map{
|
||||
"success": false,
|
||||
"message": "Your password is incorrect",
|
||||
})
|
||||
@@ -381,7 +381,7 @@ func ResetStudentPassword(c *fiber.Ctx) error {
|
||||
|
||||
if student.PersonalData.Email != data["email"] {
|
||||
cancel()
|
||||
return c.Status(fiber.StatusUnauthorized).JSON(fiber.Map{
|
||||
return c.Status(fiber.StatusOK).JSON(fiber.Map{
|
||||
"success": false,
|
||||
"message": "Your personal email is incorrect",
|
||||
})
|
||||
@@ -1214,7 +1214,7 @@ func UpdateTeacherPassword(c *fiber.Ctx) error {
|
||||
|
||||
if !teacher.ComparePasswords(data["password"]) {
|
||||
cancel()
|
||||
return c.Status(fiber.StatusUnauthorized).JSON(fiber.Map{
|
||||
return c.Status(fiber.StatusOK).JSON(fiber.Map{
|
||||
"success": false,
|
||||
"message": "Your password is incorrect",
|
||||
})
|
||||
@@ -1304,7 +1304,7 @@ func ResetTeacherPassword(c *fiber.Ctx) error {
|
||||
|
||||
if teacher.PersonalData.Email != data["email"] {
|
||||
cancel()
|
||||
return c.Status(fiber.StatusUnauthorized).JSON(fiber.Map{
|
||||
return c.Status(fiber.StatusOK).JSON(fiber.Map{
|
||||
"success": false,
|
||||
"message": "Your personal email is incorrect",
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user