Full-Stack Web Development with Vue.js and Node

(singke) #1
Building Authentication with passport.js Chapter 6

'Great!',
`You have been successfully registered!`,
'success'
)
this.$router.push({ name: 'Home' })
})
.catch((error) => {
const message = error.response.data.message;
this.$swal("Oh oo!", `${message}`, "error")
});
}
},
clear () {
this.$refs.form.reset()
}
}
}
</script>

Finally, we don't need to use the proxy anymore, so we can remove the proxy we set up


earlier from webpack.dev.conf.js.


Replace the contents inside devServer with the following code:


devServer: {
clientLogLevel: 'warning',
historyApiFallback: {
rewrites: [
{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath,
'index.html') },
],
},
hot: true,
contentBase: false, // since we use CopyWebpackPlugin.
compress: true,
host: HOST || config.dev.host,
port: PORT || config.dev.port,
open: config.dev.autoOpenBrowser,
overlay: config.dev.errorOverlay
? { warnings: false, errors: true }
: false,
publicPath: config.dev.assetsPublicPath,
quiet: true, // necessary for FriendlyErrorsPlugin
watchOptions: {
poll: config.dev.poll,
}
},
Free download pdf