login and register backend, improved redirect function, bcrypt hashing