Last active
August 13, 2017 05:49
-
-
Save laosb/81aba443e3ae0e535673326172eb6763 to your computer and use it in GitHub Desktop.
How we connect to backend accounts system on Nuxt.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios' | |
export default { | |
components: { /* Some components */ }, | |
beforeMount() { | |
//We set this on nuxtServerInit. In this way we get clientId from server. | |
if (this.$store.state._clientId) { | |
console.log('found clientId from server:', this.$store.state._clientId) | |
const bc = require('browser-cookies') | |
bc.set('__client_id', this.$store.state._clientId, { domain: 'example.com' }) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment