add access token validation logic and some media stuff

This commit is contained in:
wisplite
2025-11-22 19:51:26 -06:00
parent a78003b5a3
commit fe849f558c
6 changed files with 116 additions and 1 deletions
+9
View File
@@ -97,3 +97,12 @@ func GetUserData(authToken string) (models.User, error) {
}
return userData, nil
}
func GetUserByID(userID string) (models.User, error) {
user := models.User{}
result := db.GetDB().First(&user, "id = ?", userID)
if result.Error != nil {
return models.User{}, result.Error
}
return user, nil
}