Giter VIP home page Giter VIP logo

casdoor-vue-sdk's Issues

Nuxt 3-> Failed to load resource: the server responded with a status of 504 (Gateway Timeout)

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

Could not resolve... error after update to latest release

I update to latest release from 3. March and get the error below. Same happens also happens with a fresh yarn install after deleting node_modules

`
✘ [ERROR] Could not resolve "/home/runner/work/casdoor-vue-sdk/casdoor-vue-sdk/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"

node_modules/casdoor-vue-sdk/src/CasdoorSDK.js:1:30:
  1 │ ...asyncToGenerator from "/home/runner/work/casdoor-vue-sdk/casdoor-vue-sdk/node_modules/@babel/runtime/helpers/esm/asyncT...
    ╵                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

✘ [ERROR] Could not resolve "regenerator-runtime/runtime.js"

node_modules/casdoor-vue-sdk/src/CasdoorSDK.js:2:7:
  2 │ import "regenerator-runtime/runtime.js";
    ╵        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can mark the path "regenerator-runtime/runtime.js" as external to exclude it from the bundle,
which will remove this error.

`

Best practice

I'm sorry for asking again but I'm just stuck.
With importing Casdoor I have these functions to use:
getSignupUrl(), getSigninUrl(), getUserProfileUrl(), getMyProfileUrl(), signin()

But how to check if the user is logged in? Or the user is not deleted in the mean time.
How to check if the current user is authorized to do something?
Can you please provide a real example? Maybe I can help you with that?
I could upload an easy nuxt 3 project connecting to my demo casdoor

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.