Replace passport with custom authentication middleware; adding code to authentication process; authorisation (started)