// Copyright (c) 2025 Nikolai Papin // // This file is part of Easywish // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See // the GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . package models type Tokens struct { AccessToken string `json:"access_token"` RefreshToken string `json:"refresh_token"` } type RegistrationBeginRequest struct { Username string `json:"username" binding:"required,min=3,max=20"` Email *string `json:"email" binding:"email"` Password string `json:"password" binding:"required,password"` // TODO: password checking } // TODO: length check type RegistrationCompleteRequest struct { Username string `json:"username" binding:"required"` VerificationCode string `json:"verification_code" binding:"required"` Name string `json:"name" binding:"required,max=75"` Birthday *string `json:"birthday"` AvatarUrl *string `json:"avatar_url" binding:"http_url,max=255"` } type RegistrationCompleteResponse struct { Tokens } // TODO: length check type LoginRequest struct { Username string `json:"username" binding:"required"` Password string `json:"password" binding:"required"` TOTP *string `json:"totp"` } type LoginResponse struct { Tokens } // TODO: length check type RefreshRequest struct { RefreshToken string `json:"refresh_token" binding:"required"` } type RefreshResponse struct { Tokens }