Nuxt 3/Vue 3 compatible API wrapper for devise_token_auth
The api in this repository in not stable.
When installing, add a commit hash
// package.json
{
"dependencies": {
"devise-token-auth-vue": "github:nWacky/devise-token-auth-vue#<commit_hash>"
}
}
See the auth plugin in playground/nuxt for usage example
This probably happens due to the typescript not using package.json exports.
Fix the issue with nuxt 3:
// nuxt.config.ts
import { fileURLToPath } from "url";
export default defineNuxtConfig({
alias: {
// otherwise there's a "module-not-found-error"
//
// see https://github.com/nWacky/devise-token-auth-vue
"devise-token-auth-vue": fileURLToPath(
new URL("node_modules/devise-token-auth-vue/src/", import.meta.url)
),
},
});
I didn't really have time to debug this further, but for now the library to tsconfig.json
fixes the issue:
// tsconfig.json
{
"compilerOptions": {
"paths": {
// TODO: make sure other paths are not overwritten!
"devise-token-auth-vue": ["node_modules/devise-token-auth-vue/src/"],
"devise-token-auth-vue/*": ["node_modules/devise-token-auth-vue/src/*"]
}
}
}
This repository is using conventional commits