Video Thumbnail

Sign up for a plan to instantly unlock all premium lessons.

Premium Features

Download Video

9. Restricting Pages with Vuex

Published a year ago

export const state = () => ({
  user: null

export const mutations = {
  SET_USER(state, user) {
    state.user = user

export const actions = {
  nuxtServerInit({ commit }, { req }) {
    if (req.session && req.session.user) {
      commit('SET_USER', req.session.user)


Want to participate?

Create a free Chris Courses account to begin

Sign In

No comments yet, be the first to add one

Cheat Sheet Preview

Download The Official Chris Courses HTML5 Canvas Cheat Sheet

Essential canvas syntax at your fingertips.

Download Now

Providing the lift to launch your development career

© 2021 Chris Courses. All rights reserved.