Skip to content

useStrapiToken composable is broken in 2.1.1 #498

@Maus3rSR

Description

@Maus3rSR

Version

@nuxtjs/strapi: 2.1.1
nuxt: 4.0.3

Steps to reproduce

Nuxt config

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  strapi: {
    token: 'A TOKEN',
  }
});

Make a composable

export default async () => {
    const token = useStrapiToken();
    console.log('TOKEN', token.value)
}

Run the app

What is Expected?

Expected log to see A TOKEN

What is actually happening?

Received undefined

If reverting to @nuxtjs/strapi 2.1.0 it's working as expected.

I think the bug was introduced by this revert commit: 96ffbad

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions