client side authentication working besides saving token in local storage when using the browser