mirror of
https://github.com/miniflux/v2.git
synced 2025-06-27 16:36:00 +00:00
Refactor user validation
Validate each user field for creation/modification via API and web UI
This commit is contained in:
parent
291bf96d15
commit
e45cc2d2aa
40 changed files with 567 additions and 400 deletions
|
@ -103,12 +103,11 @@ func (h *handler) oauth2Callback(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
user = model.NewUser()
|
||||
user.Username = profile.Username
|
||||
user.IsAdmin = false
|
||||
authProvider.PopulateUserWithProfileID(user, profile)
|
||||
userCreationRequest := &model.UserCreationRequest{Username: profile.Username}
|
||||
authProvider.PopulateUserCreationWithProfileID(userCreationRequest, profile)
|
||||
|
||||
if err := h.store.CreateUser(user); err != nil {
|
||||
user, err = h.store.CreateUser(userCreationRequest)
|
||||
if err != nil {
|
||||
html.ServerError(w, r, err)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue