Skip to content

Simple JS Client Lib, based on Laravel Sanctum Authorization

License

Notifications You must be signed in to change notification settings

izzle-org/sanctum-client-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Izzle Sanctum Js Client Lib

Simple 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

About

Simple JS Client Lib, based on Laravel Sanctum Authorization

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published