mirror of
https://github.com/miniflux/v2.git
synced 2025-08-01 17:38:37 +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
|
@ -57,6 +57,10 @@ func (g *googleProvider) GetProfile(ctx context.Context, code string) (*Profile,
|
|||
return profile, nil
|
||||
}
|
||||
|
||||
func (g *googleProvider) PopulateUserCreationWithProfileID(user *model.UserCreationRequest, profile *Profile) {
|
||||
user.GoogleID = profile.ID
|
||||
}
|
||||
|
||||
func (g *googleProvider) PopulateUserWithProfileID(user *model.User, profile *Profile) {
|
||||
user.GoogleID = profile.ID
|
||||
}
|
||||
|
|
|
@ -44,6 +44,10 @@ func (o *oidcProvider) GetProfile(ctx context.Context, code string) (*Profile, e
|
|||
return profile, nil
|
||||
}
|
||||
|
||||
func (o *oidcProvider) PopulateUserCreationWithProfileID(user *model.UserCreationRequest, profile *Profile) {
|
||||
user.OpenIDConnectID = profile.ID
|
||||
}
|
||||
|
||||
func (o *oidcProvider) PopulateUserWithProfileID(user *model.User, profile *Profile) {
|
||||
user.OpenIDConnectID = profile.ID
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ type Provider interface {
|
|||
GetUserExtraKey() string
|
||||
GetRedirectURL(state string) string
|
||||
GetProfile(ctx context.Context, code string) (*Profile, error)
|
||||
PopulateUserCreationWithProfileID(user *model.UserCreationRequest, profile *Profile)
|
||||
PopulateUserWithProfileID(user *model.User, profile *Profile)
|
||||
UnsetUserProfileID(user *model.User)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue