Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when registering user #72

Closed
mirceaalexandru opened this issue May 18, 2016 · 3 comments
Closed

Error when registering user #72

mirceaalexandru opened this issue May 18, 2016 · 3 comments
Labels

Comments

@mirceaalexandru
Copy link
Collaborator

mirceaalexandru commented May 18, 2016

Sometimes we have this, because of the value from hashed password being saved:

[postgres - 4337]: ERROR: invalid byte sequence for encoding "UTF8": 0x00
STATEMENT: INSERT INTO sys_user ("nick","email","name","active","when","email_validated","force_pwd_change","salt","pass","id") values ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10)

@mirceaalexandru mirceaalexandru changed the title Error when inserting a user Error when registering user May 23, 2016
@mirceaalexandru
Copy link
Collaborator Author

The is fixed by senecajs/seneca-user#43

@mirceaalexandru
Copy link
Collaborator Author

Problem do not seems to be solved.

ERROR FROM PG:  INSERT INTO sys_user ("nick","email","name","active","when","email_validated","force_pwd_change","clients","password_change_timestamp","salt","pass","id") values ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12) [ 'user1',
  'user1@example.com',
  'user1',
  'true',
  '2016-05-24T16:32:10.966Z',
  'false',
  'false',
  '{"{\\"id\\":\\"7d3a3685-e531-49e5-b17b-b1a87422082d\\",\\"name\\":\\"Some client application\\"}"}',
  '2016-05-24T19:32:10.956+03:00',
  'P\\\b+%@\nmiN\u0015N[r\b)',
  '2acddcd59d929d1f753c0924804df02731d7be82e72d4e1e1fd96fa1277faebc20ecb07267513adf936f6bbbe95aa9fa783c9b3ee58fe281a2bf371c6414b6ee',
  '289b3932-3a7d-4c0b-bd6d-cf2bb0f8af1a' ] { [error: invalid input syntax for type bytea]
  name: 'error',
  length: 81,
  severity: 'ERROR',
  code: '22P02',
  detail: undefined,
  hint: undefined,
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: 'varlena.c',
  line: '287',
  routine: 'byteain' }

@mirceaalexandru
Copy link
Collaborator Author

The problem seems to be here:

https://github.com/senecajs/seneca-user/blob/master/user.js#L418

as this is generating values that contains invalid characters for bytea type.

mirceaalexandru added a commit that referenced this issue May 25, 2016
use custom generated salt. Fixes #72
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant