RyZ
fix: fixing auth logic
f7fe55b
package http_error
import "errors"
var (
BAD_REQUEST_ERROR = errors.New("Invalid Request Format !")
INTERNAL_SERVER_ERROR = errors.New("Internal Server Error!")
UNAUTHORIZED = errors.New("Unauthorized, you don't have permission to access this service!")
DATA_NOT_FOUND = errors.New("There is not data with given credential / given parameter!")
TIMEOUT = errors.New("Server took to long respond!")
FORBIDDEN = errors.New("Forbidden action!")
ERR_INVALID_CSRF = errors.New("Invalid CSRF token")
EXISTING_ACCOUNT = errors.New("There is existing account!")
INVALID_TOKEN = errors.New("Invalid Authentication Payload!")
DUPLICATE_DATA = errors.New("Duplicate data !")
ACCOUNT_NOT_FOUND = errors.New("There is no account with given credential!")
WRONG_PASSWORD = errors.New("Your password is wrong for given account credential, please recheck!")
INVALID_ACCOUNT_DIGITS = errors.New("Your account 3 digits is not found in account number data")
EXPIRED_TOKEN = errors.New("Token expired")
ALREADY_REGISTERED_TO_EVENT = errors.New("Account already registered to this event")
EMAIL_ALREADY_EXISTS = errors.New("Email already registered")
NOT_REGISTERED_TO_EVENT = errors.New("Account is not registered to this event")
INVALID_OTP = errors.New("Invalid OTP Code")
ERR_PROBLEM_SET_NOT_FOUND = errors.New("problem set not found")
ERR_QUESTION_NOT_FOUND = errors.New("question not found")
EVENT_FINISHED = errors.New("The event has ended, you were disallowed to do the exam!")
EVENT_NOT_STARTED = errors.New("Take it easy, event hasn't starting yet! you cannot do the exam!")
EXAMS_SUBMITTED = errors.New("You've submitted the exam, you were diasallowed to answer the question!")
// Auth Errors
ERR_USER_ALREADY_EXISTS = errors.New("User already exists")
ERR_TOKEN_GENERATION_FAILED = errors.New("Failed to generate token")
ERR_USER_NOT_FOUND = errors.New("User not found")
ERR_WRONG_PASSWORD = errors.New("Wrong password")
ERR_REGISTRATION_DISABLED = errors.New("Registration is currently disabled")
// WhatsApp Connection Errors
ERR_INVALID_ACCOUNT_ID = errors.New("Invalid account ID format")
ERR_CLIENT_INIT_FAILED = errors.New("Failed to initialize WhatsApp client")
ERR_CLIENT_CONNECT_FAILED = errors.New("Failed to connect to WhatsApp socket")
ERR_CLIENT_NOT_FOUND_FOR_ACC = errors.New("WhatsApp client not found for this account")
ERR_INVALID_JID = errors.New("Invalid JID format")
ERR_DB_CONNECTION_FAILED = errors.New("Failed to get database connection")
ERR_SQLSTORE_FAILED = errors.New("Failed to initialize SQL store")
ERR_DEVICE_STORE_FAILED = errors.New("Failed to retrieve device from store")
// Chat Errors
ERR_CLIENT_NOT_CONNECTED = errors.New("WhatsApp client is not connected")
ERR_BAD_REQUEST = errors.New("Bad request")
)