nauth-client
v1.0.13
Published
Tool for NAuth.
Downloads
17
Maintainers
Readme
NAuth - Client
Tool for NAuth System.
Example Usage:
const nauthClient = new NAuthClient({
rsaPublicKey: `-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsL9tgXW40rSPMZbl9WAm
NsIAuZSA5GrYP3Kuq285OqpAmc2lF7m8tchT7WtAlYx8Y5F2SF8yfIyflB4UEfC9
EaU/B4Gfsgt3Z5CZFKLjhrJWn+Z9DjXr496NJg+6fgp9yZC4R0XwaGnUkkkeAdb7
57eoGkvy2UJkTOieYNkY4nVF2hNQnouX2uPx82G9sXlATPkKnqV7l1M26kh1JI7+
lgXikFb37bq4dnQsekx8EL4V7VcWfdcVVHHqzgHt6F3WrhpnGJ+LT/UlzFmGeYM0
KL3NBlzn51blxsxjvw4Qxm0RzBB4pSzigDbWYCHKZrSPDEN8P2HeCv4avF4rvDhw
gQIDAQAB
-----END PUBLIC KEY-----`,
privateKeyID: "f649acf1-093a-4e18-8482-828db6c9ae59",
privateKey: "$2b$16$CVayVrz4KlK/QFV0K15E7O1dgJqN6evHVB3uu2yElzgKR6aO7Nzn2",
appID: "90355078-9d5d-4796-8af5-518677e04b53"
});
setTimeout(async () => {
///*
await nauthClient.login({
mail: "[email protected]",
password: "142536Asdf_"
}).then((res) => {
console.log("res:", res);
}).catch((err) => {
console.log("err:", err);
});
//*/
/*
nauthClient.startMailVerify({
mail: "[email protected]"
}).then((res) => {
console.log("res:", res);
}).catch((err) => {
console.log("err:", err);
});
*/
nauthClient.validateToken().then((res) => {
console.log("res:", res);
}).catch((err) => {
console.log("err:", err);
});
}, 1000);