Skip to content

Commit 5945b5c

Browse files
committed
removing debug logs
1 parent 8718914 commit 5945b5c

File tree

5 files changed

+137
-215
lines changed

5 files changed

+137
-215
lines changed

packages/auth/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@
118118
"rollup": "2.72.1",
119119
"rollup-plugin-sourcemaps": "0.6.3",
120120
"rollup-plugin-typescript2": "0.31.2",
121-
"typescript": "4.2.2"
121+
"typescript": "4.2.2",
122+
"totp-generator": "0.0.14"
122123
},
123124
"repository": {
124125
"directory": "packages/auth",

packages/auth/test/helpers/api/helper.ts

-1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,3 @@ export function mockEndpoint(
3030
): Route {
3131
return mock(endpointUrl(endpoint), response, status);
3232
}
33-

packages/auth/test/helpers/integration/helpers.d.ts

Whitespace-only changes.

packages/auth/test/helpers/integration/helpers.ts

+24-25
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@ import { Auth, User } from '../../../src/model/public_types';
2222
import { getAuth, connectAuthEmulator } from '../../../'; // Use browser OR node dist entrypoint depending on test env.
2323
import { _generateEventId } from '../../../src/core/util/event_id';
2424
import { getAppConfig, getEmulatorUrl } from './settings';
25-
import { getOobCodes, OobCodeSession, resetEmulator } from './emulator_rest_helpers';
26-
import * as config from '../../../../../config/project.json';
27-
28-
//import * as otpauth from "https://deno.land/x/[email protected]/dist/otpauth.esm.js";
29-
//// <reference path="helpers.d.ts"/>
25+
import {
26+
getOobCodes,
27+
OobCodeSession,
28+
resetEmulator
29+
} from './emulator_rest_helpers';
3030
const totp = require('totp-generator');
31-
//import * as totp from 'otpauth';
3231
interface IntegrationTestAuth extends Auth {
3332
cleanUp(): Promise<void>;
3433
}
@@ -62,8 +61,6 @@ export function getTestInstance(requireEmulator = false): Auth {
6261

6362
auth.cleanUp = async () => {
6463
// If we're in an emulated environment, the emulator will clean up for us
65-
66-
console.log('Auth cleanup should not be called');
6764
if (emulatorUrl) {
6865
await resetEmulator();
6966
} else {
@@ -83,13 +80,15 @@ export function getTestInstance(requireEmulator = false): Auth {
8380
return auth;
8481
}
8582

86-
export async function cleanUpTestInstance(auth: Auth, tests? : string): Promise<void> {
83+
export async function cleanUpTestInstance(
84+
auth: Auth,
85+
tests?: string
86+
): Promise<void> {
8787
await auth.signOut();
8888

89-
if(typeof tests === 'undefined') {
89+
if (typeof tests === 'undefined') {
9090
await (auth as IntegrationTestAuth).cleanUp();
9191
}
92-
9392
}
9493

9594
function stubConsoleToSilenceEmulatorWarnings(): sinon.SinonStub {
@@ -107,26 +106,26 @@ function stubConsoleToSilenceEmulatorWarnings(): sinon.SinonStub {
107106

108107
export async function code(toEmail: string): Promise<OobCodeSession> {
109108
const codes = await getOobCodes();
110-
console.log('codes: ', codes);
111-
112109
return codes.reverse().find(({ email }) => email === toEmail)!;
113110
}
114111

112+
export function getTotpCode(
113+
sharedSecretKey: string,
114+
periodSec: number,
115+
verificationCodeLength: number,
116+
hashingAlgorithm: string
117+
) {
118+
let token = totp(sharedSecretKey, {
119+
period: periodSec,
120+
digits: verificationCodeLength,
121+
algorithm: 'SHA-1'
122+
});
115123

116-
export function getTotpCode(sharedSecretKey: string, periodSec: number, verificationCodeLength: number, hashingAlgorithm: string){
117-
118-
let token = totp(sharedSecretKey, { period: periodSec, digits: verificationCodeLength, algorithm: 'SHA-1'});
119-
120-
121-
return token
122-
124+
return token;
123125
}
124126

125-
export function delay(dt:number){
126-
127-
console.log('Delay called');
128-
129-
return new Promise(resolve => setTimeout(resolve, dt));
127+
export function delay(dt: number) {
128+
return new Promise(resolve => setTimeout(resolve, dt));
130129
}
131130

132131
export const email = '[email protected]';

0 commit comments

Comments
 (0)