1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-04-22 07:47:46 +02:00

added new lines for readability and consistency

This commit is contained in:
Gani Georgiev 2022-07-14 20:01:53 +03:00
parent a16b0c9004
commit dbbfa243bc
3 changed files with 4 additions and 0 deletions

View File

@ -100,6 +100,7 @@ func (form *UserOauth2Login) Submit() (*models.User, *auth.AuthUser, error) {
} }
return user, authData, nil return user, authData, nil
} }
if !config.AllowRegistrations { if !config.AllowRegistrations {
// registration of new users is not allowed via the Oauth2 provider // registration of new users is not allowed via the Oauth2 provider
return nil, authData, errors.New("Cannot find user with the authorized email.") return nil, authData, errors.New("Cannot find user with the authorized email.")

View File

@ -69,6 +69,7 @@ func NewRecordFromNullStringMap(collection *Collection, data dbx.NullStringMap)
// each row in the provided NullStringMap slice. // each row in the provided NullStringMap slice.
func NewRecordsFromNullStringMaps(collection *Collection, rows []dbx.NullStringMap) []*Record { func NewRecordsFromNullStringMaps(collection *Collection, rows []dbx.NullStringMap) []*Record {
result := make([]*Record, len(rows)) result := make([]*Record, len(rows))
for i, row := range rows { for i, row := range rows {
result[i] = NewRecordFromNullStringMap(collection, row) result[i] = NewRecordFromNullStringMap(collection, row)
} }

View File

@ -153,11 +153,13 @@ func (f FilterData) resolveToken(token fexpr.Token, fieldResolver FieldResolver)
} }
return "", nil, err return "", nil, err
} }
return name, params, err return name, params, err
case fexpr.TokenNumber, fexpr.TokenText: case fexpr.TokenNumber, fexpr.TokenText:
placeholder := "t" + security.RandomString(7) placeholder := "t" + security.RandomString(7)
name := fmt.Sprintf("{:%s}", placeholder) name := fmt.Sprintf("{:%s}", placeholder)
params := dbx.Params{placeholder: token.Literal} params := dbx.Params{placeholder: token.Literal}
return name, params, nil return name, params, nil
} }