debugging authorisation
fixed a bug on authentication