perarnborg / vuex-oidc-example

66 stars 33 forks source link

Get oidc vuex data Error #6

Open findmoon opened 5 years ago

findmoon commented 5 years ago

when i use vuex datas (getters or actions),the follew error will happened:

 Property or method "oidcIsAuthenticated" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.

use methods

<template>
 <div>
<div v-if="oidcIsAuthenticated">12</div>
</div>
</template>
<script></script>
import { mapActions } from 'vuex'
import { mapGetters } from 'vuex'

export default {
  name: "SlideSideBar",
  computed:{
    ...mapGetters('oidcStore',[
          'oidcIsAuthenticated'
        ])
  },
  methods: {
    ...mapActions('oidcStore',[
      'signOutOidc'
    ])
  },

what should i do?thansk for help。

AND there is another bug(i dot't konwn whether a bug)。when goto authentication aerver login,it always loop to login page(302 redirect),dot not return to vue page。。。 感谢!

perarnborg commented 5 years ago

Strange, it sounds like something is wrong with your setup.

How did you create your vuex store module? Are you sure you created it as a namespaced module with the name oidcStore?