Closed Kingside88 closed 2 years ago
@seriouszyx @ComradeProgrammer @Resulte
Hi, I am not sure if I am doing something wrong or there is a bug. I want to use it with nuxt 3. I created a filte "casdoor.ts" under plugins folder with following lines of code (modified):
`import Casdoor from 'casdoor-vue-sdk'
const config = { serverUrl: "https://casdoor.devandy.de", clientId: "xxx", organizationName: "xxx", appName: "xxx", redirectPath: "/callback", requireHttpsMetadata: false };
export default defineNuxtPlugin(async nuxtApp => { nuxtApp.vueApp.use(Casdoor, config) })
And under **composables**:
import { useCasdoor } from 'casdoor-vue-sdk';export default { setup() {
const { getSigninUrl, getSignupUrl } = useCasdoor(); function login() { window.location.href = getSigninUrl(); } function signup() { window.location.href = getSignupUrl(); } return { login, signup }
} }`
But than I got an JavaScript Error: Failed to load resource: the server responded with a status of 504 (Gateway Timeout) RequestURL: http://localhost:3000/_nuxt/node_modules/.vite/deps/ufo.js?v=dcaeb125
Hello! can you give us more detailed information to reproduce this problem?
We need to know:
If possible, you can provide us a minimal reproducible example, such as a docker image that include the project you encountered this problem and it's dependencies, including your frontend and backend would be better.
Thanks for your time.
I figured it out. My problem was, I did not added "Redirect URLs" in casdoor Application. So I added my localhost:3000 entry and then it works fine.
Hi, I am not sure if I am doing something wrong or there is a bug. I want to use it with nuxt 3. I created a filte "casdoor.ts" under plugins folder with following lines of code (modified):
`import Casdoor from 'casdoor-vue-sdk'
const config = { serverUrl: "https://casdoor.devandy.de", clientId: "xxx", organizationName: "xxx", appName: "xxx", redirectPath: "/callback", requireHttpsMetadata: false };
export default defineNuxtPlugin(async nuxtApp => { nuxtApp.vueApp.use(Casdoor, config) })
And under **composables**:
import { useCasdoor } from 'casdoor-vue-sdk';export default { setup() {
} }`
But than I got an JavaScript Error: Failed to load resource: the server responded with a status of 504 (Gateway Timeout) RequestURL: http://localhost:3000/_nuxt/node_modules/.vite/deps/ufo.js?v=dcaeb125