Token generation for custom login