feature: Adds user lookup support.

This commit is contained in:
greysoh 2024-12-22 13:58:18 -05:00
parent cee4e62f53
commit 611d7f24f8
Signed by: imterah
GPG key ID: 8FA7DD57BA6CEA37
4 changed files with 142 additions and 5 deletions

View file

@ -29,8 +29,6 @@ type UserCreationRequest struct {
}
func CreateUser(c *gin.Context) {
var req UserCreationRequest
if !signupEnabled && !unsafeSignup {
c.JSON(http.StatusForbidden, gin.H{
"error": "Signing up is not enabled at this time.",
@ -39,6 +37,8 @@ func CreateUser(c *gin.Context) {
return
}
var req UserCreationRequest
if err := c.BindJSON(&req); err != nil {
c.JSON(http.StatusBadRequest, gin.H{
"error": fmt.Sprintf("Failed to parse body: %s", err.Error()),