Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

slashtags/slashauth-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

slashtags-auth-client

Installation

npm install @slashtags/slashauth-client

Usage

const { SlashAuthClient } = require('@slashtags/slashauth-client')
const { generateKeyPair } = require('noise-curve-ed')

const keypair = generateKeyPair()
// use authServer's publicKey for pinning
const client = new SlashAuthClient({ keypair })

const slashauthURL = 'slashauth:47mqszp49u9a1ticnki5mwgx417qbhgz6qtg1n67n9zou436rh9y/v0.1/auth?token=token&relay=http://localhost:3000
'
const response = await client.authz(slashauthURL)
// { status: 'ok', token: 'token' }

const link = await client.magiclik(slashauthURL)
// { status: 'ok', ml: 'https://www.example.com?q=foobar' }

See https://github.com/slashtags/slashauth for server side implementation

Releases

No releases published

Packages

No packages published