Inject login and logout functions