-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
38 lines (32 loc) · 827 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
"use strict";
// Dependencies
const readLine = require("readline-sync")
const request = require("request-async")
// Variables
const pao = {
masterKey: "Pao",
url: "http://localhost:8080/"
}
// Functions
async function start(){
console.log("Pao Framework Verification.")
const code = readLine.question("Code -> ")
var response = await request(`${pao.url}pverify?code=${code}`, {
headers: {
"pao-sk": pao.masterKey
}
})
response = JSON.parse(response.body)
if(response.status === "verified"){
console.log("Successfully verified.")
process.exit()
}else if(response.status === "already"){
console.log("Already verified.")
}else{
console.log("Failed to verify.")
}
console.clear()
start()
}
// Main
start()