@izzle-org/sanctum-client
v0.0.1
Published
Simple JS Client Lib, based on Laravel Sanctum Authorization
Downloads
5
Readme
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