added convenience method to get the user_id from the token if exists, and DRYed up a bit