Skip to content

NETWORK-Z-Dev/dSyncAuth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dSyncAuth

dSyncAuth is an addition to dSync that uses dSyncSign to create random encrypted challenges and checks if the decrypted response from a user is correct. It also requires epxress.

Important

This document is work in progress and will be updated in the future. It will show more examples and details somewhere in the future.


Init

The following example is a very basic example on how to initialize dSyncAuth. Once you've done this its already good to go.

import dSyncAuth from '@hackthedev/dsync-auth';
import { dSyncSign } from "@hackthedev/dsync-sign";

const signer = new dSyncSign();
const auther = new dSyncAuth(app, signer)

You can also define callbacks to capture specific events, like onVerify and onLogin like this.

const auther = new dSyncAuth(app, signer, async function(data) {
    if(data.valid === true){
        // do something with the data
    }
});

About

Library for validating public keys using a simple challenge mechanic

Resources

Stars

Watchers

Forks

Contributors