Update index.js

trim this.tok to avoid build fail when someone add blank to token.