debug
parent
ea4aa84a97
commit
8bbedaffde
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"api/database"
|
"api/database"
|
||||||
"api/models"
|
"api/models"
|
||||||
"api/utils"
|
"api/utils"
|
||||||
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
@ -194,6 +195,8 @@ func Checkuser(c *fiber.Ctx) error {
|
||||||
// Check if user exists
|
// Check if user exists
|
||||||
database.DB.Where("email = ?", email).First(&user)
|
database.DB.Where("email = ?", email).First(&user)
|
||||||
|
|
||||||
|
fmt.Printf("User Channel: [%s]\n", user.Channel)
|
||||||
|
|
||||||
if user.ID == 0 {
|
if user.ID == 0 {
|
||||||
// The user is not found; let's check if it's a test user
|
// The user is not found; let's check if it's a test user
|
||||||
database.DB.Where("email = ?", email).First(&usertest)
|
database.DB.Where("email = ?", email).First(&usertest)
|
||||||
|
|
@ -211,10 +214,10 @@ func Checkuser(c *fiber.Ctx) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// The user is found and it's a payable user; let's signalize this
|
// The user is found and it's a pay user; let's signalize this
|
||||||
if user.UserType == "U" {
|
if user.UserType == "U" {
|
||||||
response.Type = "U"
|
response.Type = "U"
|
||||||
// If the user doesn't have a channel, it's a social user that needs to complete the registration
|
// If the user doesn't have a channel, it's a pay user that needs to complete the registration
|
||||||
if user.Channel == "" {
|
if user.Channel == "" {
|
||||||
response.Type = "RU"
|
response.Type = "RU"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue