fix bugs in current_user assignment
update to token encryption