Comparing version 0.0.5 to 1.0.0
@@ -0,1 +1,13 @@ | ||
# v1.0.0 (Mon Nov 18 2019) | ||
#### 💥 Breaking Change | ||
- feat: Rename authorize to verify and Type fixes (william@ordino.ai) | ||
#### Authors: 1 | ||
- William Luke (william@ordino.ai) | ||
--- | ||
# v0.0.5 (Mon Nov 18 2019) | ||
@@ -2,0 +14,0 @@ |
@@ -10,3 +10,10 @@ interface LoginAuth { | ||
} | ||
export declare function authorize({ key, identifier, challengeId, secret, oth }: Auth): Promise<void>; | ||
interface Data { | ||
status: number; | ||
success: Boolean; | ||
fast_id: unknown; | ||
challenge_ip: string; | ||
challenge_ts: string; | ||
} | ||
export declare function verify({ key, identifier, challengeId, secret, oth }: Auth): Promise<Data>; | ||
export declare function login({ identifier, key }: LoginAuth): Promise<void>; | ||
@@ -13,0 +20,0 @@ interface AuthResult { |
@@ -11,3 +11,3 @@ "use strict"; | ||
const APP_SECRET = process.env.APP_SECRET; | ||
async function authorize({ key, identifier, challengeId, secret, oth }) { | ||
async function verify({ key, identifier, challengeId, secret, oth }) { | ||
secret = typeof secret === 'undefined' ? APP_SECRET : secret; | ||
@@ -18,5 +18,5 @@ const verify = url.directory("api/verify").query({ challengeId: challengeId, oth: oth, identifier: identifier, key: key, secret: secret }); | ||
const data = await response.json(); // parses JSON response into native JavaScript objects | ||
console.log(data); | ||
return data; | ||
} | ||
exports.authorize = authorize; | ||
exports.verify = verify; | ||
async function login({ identifier, key }) { | ||
@@ -23,0 +23,0 @@ // Endpoint: https://api.fast.co/api/invite |
{ | ||
"name": "auth-fast", | ||
"version": "0.0.5", | ||
"version": "1.0.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -1,1 +0,1 @@ | ||
# WIP | ||
# WIP |
@@ -22,7 +22,7 @@ require('es6-promise').polyfill(); | ||
success: Boolean, | ||
fast_id: unknown, | ||
fast_id: string | null, | ||
challenge_ip: string, | ||
challenge_ts: string, | ||
} | ||
export async function authorize({ | ||
export async function verify({ | ||
key, | ||
@@ -40,3 +40,3 @@ identifier, | ||
const data: Data = await response.json(); // parses JSON response into native JavaScript objects | ||
console.log(data); | ||
return data | ||
} | ||
@@ -46,7 +46,5 @@ export async function login({identifier, key}: LoginAuth){ | ||
const invite = url.directory("api/invite").query({ identifier: identifier, key: key}); | ||
console.log(invite.query()) | ||
console.log(invite.valueOf()); | ||
const response = await fetch(invite.valueOf()); | ||
const data: Data = await response.json(); // parses JSON response into native JavaScript objects | ||
console.log(data); | ||
return data | ||
} | ||
@@ -53,0 +51,0 @@ |
require('dotenv').config() | ||
import { authorize, login, getParams } from '../src' | ||
import { verify, login, getParams } from '../src' | ||
const test_identifier = process.env.TEST_IDENTIFIER | ||
@@ -18,5 +18,5 @@ const test_oth = process.env.TEST_OTH | ||
async function test_authorize() { | ||
async function test_verify() { | ||
if(app_key && test_identifier && test_challengeid && test_oth){ | ||
await authorize({ | ||
await verify({ | ||
key: app_key, | ||
@@ -23,0 +23,0 @@ identifier: test_identifier, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
12766
225
0
2