npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

vue-auth-laravel

v0.1.3

Published

auth user with vuex and axios

Readme

vue-auth-laravel

package for authentication user in client-side by using cookies and vuex. as we know we just load page once in SPA because of that i write a small package for authentications user there.

How it is work?

when user refresh page we call function checkToken which will send a request get to server in a specific url. which must impelement in back-end side and must return current authenticate user in json fromat with an access token.

i will take this token and put it inside axios headers to make a whole requests to be auth.

Installation

npm install @hazemha/vue-auth-laravel

Usage

use checkToken in main compoent

url: it's endpoint in server-side which will handle the requests.

To avoid problem use the same format in server-side

1- checkToken

public function checkMyLogin()
{
    if (\Auth::guard('api')->check()) {
        return response()->json(['auth' => true, 'user' => \Auth::guard('api')->user()], 200);
    }

    return response()->json(['auth' => false], 200);
}

2- login

   public function Login(Request $request)
    {
        $credentials = $request->only('email', 'password');
        if (\Auth::attempt($credentials)) {
            \Auth::user()->access_token = \Auth::user()->createToken('Token Name')->accessToken;
            $result = \Auth::user()->save();
            return response()->json(['user' => \Auth::user(), 'auth' => $result], 200);
        }
        return response()->json(['message' => 'please check form your credentials'], 401);
    }

3- logout

     public function Logout()
    {
        \Auth::user()->access_token = null;
        $result = \Auth::user()->save();
        return response()->json(['message' => $result], 200);
    }

API

1- checkToken this.$authLaravel.login('url') return the response from the server to you and check if the user login before to avoid login again 2- login data = url and post data for example data ={url:'api\login',user:'username',password:'123123'} this.$authLaravel.login(data) return the response from the server to you 3- logout this.$authLaravel.login('url') return the response from the server to you

3- isAuth this.$authLaravel.isAuth() return is current user is login before or not and is Auth