fix(settings): auth hash accidentally overridden
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -50,10 +50,11 @@ func (dt *databaseTest) TestUser() {
|
||||
t.Fatalf(`Expected: %v, Got: %v, Error: %v`, nil, err, err)
|
||||
}
|
||||
|
||||
authHash := fmt.Sprintf("%x", rawAuthHash)
|
||||
changed, err := dt.dbm.Queries.CreateUser(dt.dbm.Ctx, CreateUserParams{
|
||||
ID: userID,
|
||||
Pass: &userPass,
|
||||
AuthHash: fmt.Sprintf("%x", rawAuthHash),
|
||||
AuthHash: &authHash,
|
||||
})
|
||||
|
||||
if err != nil || changed != 1 {
|
||||
|
||||
@@ -96,7 +96,7 @@ type Metadatum struct {
|
||||
type User struct {
|
||||
ID string `json:"id"`
|
||||
Pass *string `json:"-"`
|
||||
AuthHash string `json:"auth_hash"`
|
||||
AuthHash *string `json:"auth_hash"`
|
||||
Admin bool `json:"-"`
|
||||
TimeOffset *string `json:"time_offset"`
|
||||
CreatedAt string `json:"created_at"`
|
||||
|
||||
@@ -121,7 +121,7 @@ ON CONFLICT DO NOTHING
|
||||
type CreateUserParams struct {
|
||||
ID string `json:"id"`
|
||||
Pass *string `json:"-"`
|
||||
AuthHash string `json:"auth_hash"`
|
||||
AuthHash *string `json:"auth_hash"`
|
||||
}
|
||||
|
||||
func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (int64, error) {
|
||||
@@ -1225,7 +1225,7 @@ RETURNING id, pass, auth_hash, admin, time_offset, created_at
|
||||
|
||||
type UpdateUserParams struct {
|
||||
Password *string `json:"-"`
|
||||
AuthHash string `json:"auth_hash"`
|
||||
AuthHash *string `json:"auth_hash"`
|
||||
TimeOffset *string `json:"time_offset"`
|
||||
UserID string `json:"user_id"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user