@izzle-org/sanctum-client

0.0.1 • Public • Published

Izzle Sanctum Js Client Lib

Simple JS Client Lib, based on Laravel Sanctum Authorization

Installation

Using npm:

$ npm i -g npm
$ npm i @izzle-org/sanctum-client

Usage

Login:

import { AuthService } from '@izzle-org/sanctum-client'

AuthService.init('https://api.foo.bar/sanctum/token')
AuthService.login('max', 'foobar', 'iPhone')
    .then(() => {
        // Success
    })
    .catch(error => {
       // Handle Error
       console.log(error)
    })

Check Auth:

import { AuthService } from '@izzle-org/sanctum-client'

if (AuthService.loggedIn()) {
    // Logged In
}

License

Copyright (c) 2020-present Daniel Böhmer

MIT License

/@izzle-org/sanctum-client/

    Package Sidebar

    Install

    npm i @izzle-org/sanctum-client

    Weekly Downloads

    2

    Version

    0.0.1

    License

    MIT

    Unpacked Size

    4.56 kB

    Total Files

    8

    Last publish

    Collaborators

    • sicbb