websanova / vue-auth

A simple light-weight authentication library for Vue.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support pinia for vue 3

tachibana-shin opened this issue · comments

Hello,

The official version of vue 3 has announced the official removal of vuex and replacement with pinia will you be able to update the library to use pinia instead of vuex?

This library does not use vuex or any other "state lib over vue".
In your own project you can do anything what you want.

Thank you for your reply. But it doesn't seem like this library meets my needs anymore with vue 3 &typescript so I created the new plugin: vue-auth3.js.org

とにかく胡坐等ござい松

Maybe you miss v3.js ?
https://github.com/websanova/vue-auth/blob/master/src/v3.js

Also you can use axios/frisbee/anyting you want via custom http driver.
What problems your vue-auth3 package resolves ?

I need the application to store user-data in and refresh in the background. it's pointless to be blocked for trying to get authentication information

I also need a highly introspective composition API such as well useUser<UserData>() is ComputedRef<UserData>

I need the application to store user-data in and refresh in the background

And what problems with it ?

I also need a highly introspective composition API such as well useUser() is ComputedRef

Well, UserData is not deterministic, and should be defined in your app.
Why not use some thin "wrapper" instead of creating lib ?

I'm using it for an Android app. I can't wait for 2 requests to be processed when starting the application. It's too slow. So I had to create another plug-in to enable efficient caching of logged-in user information. It's like when you open YouTube offline, and you'll still see your account there.

I see now. Anyway you can disable all refresh user features, and get/set user information from JWT token for example.
But agree, seems it not simple as it seems. Like check JWT token sign and call something like $auth.user(decodedToken) on every load etc.
Also you can implement you own storage if cookie/localStorage/sessionStorage not feet your needs.