0.0.1 • Published 4 years ago
@izzle-org/sanctum-client v0.0.1
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:
```js
import { AuthService } from '@izzle-org/sanctum-client'
if (AuthService.loggedIn()) {
// Logged In
}
License
Copyright (c) 2020-present Daniel Böhmer
0.0.1
4 years ago