@steffesgroup/steffes-auth
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -10,3 +10,3 @@ import { AxiosInstance, AxiosRequestConfig, AxiosResponse, CancelToken } from 'axios'; | ||
refreshToken(refreshTokenDTO: RefreshTokenDTO): Promise<TokenDTO>; | ||
verifyTwoFactorToken(email?: string | null | undefined, token?: string | null | undefined): Promise<TokenDTO>; | ||
verifyTwoFactorToken(verifyTwoFactorDTO: VerifyTwoFactorDTO): Promise<TokenDTO>; | ||
confirmEmail(email?: string | null | undefined, token?: string | null | undefined): Promise<FileResponse>; | ||
@@ -26,3 +26,3 @@ externalLogin(provider?: string | null | undefined, platform?: string | null | undefined, returnUrl?: string | null | undefined): Promise<FileResponse>; | ||
protected processRefreshToken(response: AxiosResponse): Promise<TokenDTO>; | ||
verifyTwoFactorToken(email?: string | null | undefined, token?: string | null | undefined, cancelToken?: CancelToken | undefined): Promise<TokenDTO>; | ||
verifyTwoFactorToken(verifyTwoFactorDTO: VerifyTwoFactorDTO, cancelToken?: CancelToken | undefined): Promise<TokenDTO>; | ||
protected processVerifyTwoFactorToken(response: AxiosResponse): Promise<TokenDTO>; | ||
@@ -118,2 +118,14 @@ confirmEmail(email?: string | null | undefined, token?: string | null | undefined, cancelToken?: CancelToken | undefined): Promise<FileResponse>; | ||
} | ||
export declare class VerifyTwoFactorDTO implements IVerifyTwoFactorDTO { | ||
email?: string | undefined; | ||
token?: string | undefined; | ||
constructor(data?: IVerifyTwoFactorDTO); | ||
init(_data?: any): void; | ||
static fromJS(data: any): VerifyTwoFactorDTO; | ||
toJSON(data?: any): any; | ||
} | ||
export interface IVerifyTwoFactorDTO { | ||
email?: string | undefined; | ||
token?: string | undefined; | ||
} | ||
export declare class RegisterUserDTO implements IRegisterUserDTO { | ||
@@ -120,0 +132,0 @@ firstName?: string | undefined; |
@@ -11,3 +11,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.IConfig = exports.ApiException = exports.UpdatePhoneDTO = exports.VerifyPhoneDTO = exports.CreateUserDTO = exports.RegistrationState = exports.UserDTO = exports.Address = exports.RegisterUserDTO = exports.RefreshTokenDTO = exports.LoginDTO = exports.TokenDTO = exports.UserClient = exports.RegisterClient = exports.AuthClient = exports.AuthorizedApiBase = void 0; | ||
exports.IConfig = exports.ApiException = exports.UpdatePhoneDTO = exports.VerifyPhoneDTO = exports.CreateUserDTO = exports.RegistrationState = exports.UserDTO = exports.Address = exports.RegisterUserDTO = exports.VerifyTwoFactorDTO = exports.RefreshTokenDTO = exports.LoginDTO = exports.TokenDTO = exports.UserClient = exports.RegisterClient = exports.AuthClient = exports.AuthorizedApiBase = void 0; | ||
const axios_1 = require("axios"); | ||
@@ -136,13 +136,12 @@ class AuthorizedApiBase { | ||
} | ||
verifyTwoFactorToken(email, token, cancelToken) { | ||
let url_ = this.baseUrl + "/api/v1/Auth/Verify/TwoFactor?"; | ||
if (email !== undefined && email !== null) | ||
url_ += "email=" + encodeURIComponent("" + email) + "&"; | ||
if (token !== undefined && token !== null) | ||
url_ += "token=" + encodeURIComponent("" + token) + "&"; | ||
verifyTwoFactorToken(verifyTwoFactorDTO, cancelToken) { | ||
let url_ = this.baseUrl + "/api/v1/Auth/Verify/TwoFactor"; | ||
url_ = url_.replace(/[?&]$/, ""); | ||
const content_ = JSON.stringify(verifyTwoFactorDTO); | ||
let options_ = { | ||
method: "GET", | ||
data: content_, | ||
method: "POST", | ||
url: url_, | ||
headers: { | ||
"Content-Type": "application/json", | ||
"Accept": "application/json" | ||
@@ -902,2 +901,31 @@ }, | ||
exports.RefreshTokenDTO = RefreshTokenDTO; | ||
class VerifyTwoFactorDTO { | ||
constructor(data) { | ||
if (data) { | ||
for (var property in data) { | ||
if (data.hasOwnProperty(property)) | ||
this[property] = data[property]; | ||
} | ||
} | ||
} | ||
init(_data) { | ||
if (_data) { | ||
this.email = _data["email"]; | ||
this.token = _data["token"]; | ||
} | ||
} | ||
static fromJS(data) { | ||
data = typeof data === 'object' ? data : {}; | ||
let result = new VerifyTwoFactorDTO(); | ||
result.init(data); | ||
return result; | ||
} | ||
toJSON(data) { | ||
data = typeof data === 'object' ? data : {}; | ||
data["email"] = this.email; | ||
data["token"] = this.token; | ||
return data; | ||
} | ||
} | ||
exports.VerifyTwoFactorDTO = VerifyTwoFactorDTO; | ||
class RegisterUserDTO { | ||
@@ -904,0 +932,0 @@ constructor(data) { |
{ | ||
"name": "@steffesgroup/steffes-auth", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "Steffes Auth", | ||
@@ -5,0 +5,0 @@ "main": "dist/api.js", |
58454
1518