Tokenbased Authentication system now works properly