nuxt-module-alternatives icon indicating copy to clipboard operation
nuxt-module-alternatives copied to clipboard

[auth] Cannot get user information

Open 4xy0m opened this issue 3 years ago • 0 comments

Heyyy,

i need help please, loggedIn stay in false

nuxt.config.ts:

import { defineNuxtConfig } from "nuxt";

export default defineNuxtConfig({
  modules: [
    "@nuxtjs-alt/auth",
    "@nuxtjs-alt/http",
    "@pinia/nuxt",
  ],
  auth: {
    strategies: {
      localStorage: false,
      discord: {
        clientId: "CLIENT ID",
        clientSecret: "CLIENT SECRET",
        redirectUri: "REDIRECT URI",
      },
    },
  },
});

index.vue:

<template>
  <div class="hero">
    <button @click="$auth.loginWith('discord')">Test</button>
  </div>
</template>

dashboard.vue:

<template>
    <div>
        {{ $auth.loggedIn }}
    </div>
</template>

4xy0m avatar Sep 16 '22 21:09 4xy0m