Password resetation#161
Conversation
Jusu05
commented
Mar 22, 2026
- Added temporary pasword resetation to backend
- Seperated roles out of database
ArktinenKarpalo
left a comment
There was a problem hiding this comment.
Tests for password reset are lacking. It's questionable whether authenticateUser works correctly for temporary passwords?
|
|
||
| export const createTempPassword = async (userId, userName) => { | ||
| const now = new Date(); | ||
| const hash = bcrypt.hashSync(`${userName}${now.getMilliseconds()}${userId}`, 11); |
There was a problem hiding this comment.
is there a reason why temp password is not generated with crypto.RandomBytes instead?
There was a problem hiding this comment.
No good reason that function looks to do same thing but better
|
Why are roles separated out of the database? Now by looking at the database its difficult to say what it means for user to have role 2 or 7, or which roles are even available. I think they should be kept in the ROLES table. |
|
If you remove v1 auth endpoint you should check that existing services like rv.tko-aly.fi still work, or alternatively we could have for the time being both v1 and v2 auth endpoints. |
It's Eesier edit them from the backend code and it's simular than the action ids |
But there is ACTION table for the action IDs as well, which can be edited from backend code as well via migrations. |