Giter VIP home page Giter VIP logo

vue-router-user-roles's Issues

User with multiple roles

Hi, thanks for the great lib - real timesaver!

Is it possible to handle a user with multiple roles though as we have this requirement now?

Read me part is missing !!!

vue & vue-router-permissions version

vue: 2.6.4
vue-router: ^3.0.2

Reproduction Link

Out of the box

Steps to reproduce

Setup access per documentation. Notice how when you have a protected route, it will flash before redirecting when access is not allowed.

What is Expected?

read me part is missing.

What is actually happening?

Correct the read me part. Because npm package name is missing.

e9faca86-fd20-4fa8-b86a-b92a2debb2cb

Things that need to be done

  • Setup linter correctly.
  • Setup testing. Currently karma is being used. Remove that and replace with Jest.
  • Create unit tests.
  • Setup circleci.
  • e2e tests

Feature ideas:

  • $user.hasAccess({ name: "routename" }). This could be useful for conditionally displaying links depending on access.
  • $user.set({...}, { redirect: false }). Stop the page from automatically redirect when setting a user.

Other:

  • Usage with Vuex?

Does this login flow look doable?

Just seen this, looks like a great project!

I have this login flow using Amazon Cognito for the user login, but I also want to load site data when the site first loads, and user data after login or site reload (when there will be an auth token in local storage, but no user data).

image

I'm pretty sure it's my final flow.

You think it's doable with your plugin?

Protected content appears before role validation is complete

vue & vue-router-permissions version

Vue -- 2.5.21
Vue Router -- 3.0.2

Reproduction Link

Out of the box

Steps to reproduce

Setup access per documentation. Notice how when you have a protected route, it will flash before redirecting when access is not allowed.

What is Expected?

Protected content will not be shown during access validation. Should most likely tie into VueRouter's navigation guards logic (ie beforeEach) to bring validation higher up the chain.

What is actually happening?

Protected content is appearing on screen before access validation is performed and executed.

Handle dynamic parameter routes

Thanks for this library - it is very useful. One feature request please:

Handle dynamic routes. My app requires no logins, because it's using Windows Auth and AD. I have a Vue component that handles errors, which takes a route parameter for the error code, e.g. for unauthorized user I would pass 403 as the code for Forbidden, and the page would display something specific relating to that issue (want to request access? blah blah):

      {
        role: "guest",
        access: false,
        redirect: "oops/403"
      }

But it seems this does not work.

Your consideration would be much appreciated.

Missing module file on package.json

package.json has wrong module file "module": "dist/vue-router-user-roles.esm.js",, that file doesn't exists

vue & vue-router-permissions version

vue 2.6.14
vite 2.7.12
vue-router-user-roles 0.1.92

Reproduction Link

Steps to reproduce

run yarn dev

What is Expected?

No errors

What is actually happening?

Vite get error message
[plugin:vite:import-analysis] Failed to resolve entry for package "vue-router-user-roles". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "vue-router-user-roles". The package may have incorrect main/module/exports specified in its package.json.

Installation instruction why with -D in the end?

First off, sorry for opening this issue for this, but I didn't see a way to mention this other wise.

Why is there a -D appended in the installation instructions? I understand -D flags for installations in dev-dependencies, but I would like this functionality to be available in production as well. Am I missing something?

Question: best way to keep user state on refresh page?

I've just implemented this library on my first apollo/vue project ๐Ÿ”ฅ

I love the way you thinked your lib <3 but still have a question! And I think I'll not be the unique one with this question.

After login an user and provide his payload on the $user what's your recommendation to keep the user logged in ($user hydrated) also with browser refresh ?

I've thinked to keep my user's JWT's token on the localStorage and at each refresh just query my API to verify the JWT and re-populate my data on $user.

Another practice or maybe a good practice ?? ๐Ÿ˜„

PS : I can probably contributing to your documentation to add this point. It can be helpfull for other developers who want to implement your lib.

Cheers <3

so many errors

lost role property after reload page, and how use role, if I want not one ROLE?

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.