@@ -139,6 +139,8 @@ func (s *Server) AuthRefresh(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
s.issueTokens(w, r, user)
|
s.issueTokens(w, r, user)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// working
|
||||||
func (s *Server) AuthRegister(w http.ResponseWriter, r *http.Request) {
|
func (s *Server) AuthRegister(w http.ResponseWriter, r *http.Request) {
|
||||||
ctx := r.Context()
|
ctx := r.Context()
|
||||||
var req api.RegisterRequest
|
var req api.RegisterRequest
|
||||||
@@ -163,6 +165,7 @@ func (s *Server) AuthRegister(w http.ResponseWriter, r *http.Request) {
|
|||||||
Slug: s.GenerateUserSlug(req.FullName, uuid),
|
Slug: s.GenerateUserSlug(req.FullName, uuid),
|
||||||
CreatedAt: now,
|
CreatedAt: now,
|
||||||
UpdatedAt: now,
|
UpdatedAt: now,
|
||||||
|
Role: string(req.Role),
|
||||||
Email: string(req.Email),
|
Email: string(req.Email),
|
||||||
PasswordHash: string(passwordHash),
|
PasswordHash: string(passwordHash),
|
||||||
FullName: req.FullName,
|
FullName: req.FullName,
|
||||||
|
|||||||
Reference in New Issue
Block a user