<script lang="ts">
import LoginAdmin from '@/components/LoginAdmin.vue'
import { Component, Vue } from 'nuxt-property-decorator'
import Auth from "@nuxtjs/auth";
export default class MyStore extends Vue {
public username:string="";
public password:string="";
public error:string="";
async login(){
try {
await this.$auth.loginWith('local', {
data: {
email: this.username,
password: this.password
},
})
console.log(this.$auth.loggedIn)
// this.$router.push('/')
} catch (e) {
console.log(e.message)
}
}
}
</script>
I am facing an issue with calling this.$auth inside a class in TypeScript within Nuxt. Any suggestions on how I can properly access it?