Fix core login functionality

- Changed the misnamed variable to `$type` in `set_glue_globals()`
- fixed authenticate to pass the user_name instead of the user object
into $AJXP_GLUE_GLOBALS