Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia
TypeScript apiapi-clientapi-restapi-testingdeveloper-toolsgraphqlhttphttp-clientpwarestrest-apispatestingtesting-toolstoolsvuevuejswebsocket
chore: updated .env.example file with new data
Balu Babuee3fbabececd
diff --git a/packages/hoppscotch-backend/.env.example b/packages/hoppscotch-backend/.env.exampleindex 2423391b0..78700ecaf 100644--- a/packages/hoppscotch-backend/.env.example+++ b/packages/hoppscotch-backend/.env.example@@ -7,12 +7,13 @@ POSTMARK_SENDER_EMAIL=************************************************"# Auth Tokens ConfigJWT_SECRET='add some secret here'-REFRESH_TOKEN_VALIDITY="168h" # Default validity is 7 days-ACCESS_TOKEN_VALIDITY="30s" # Default validity is 1 day+REFRESH_TOKEN_VALIDITY="604800000" # Default validity is 7 days+ACCESS_TOKEN_VALIDITY="120000" # Default validity is 1 day# Hoppscotch App Domain ConfigAPP_DOMAIN="************************************************""REDIRECT_URL="************************************************""+WHITELISTED_ORIGINS ="************************************************"# Google Auth ConfigGOOGLE_CLIENT_ID="************************************************"@@ -24,3 +25,9 @@ GOOGLE_SCOPE= ['email', 'profile'],GITHUB_CLIENT_ID="************************************************"GITHUB_CLIENT_SECRET="************************************************"GITHUB_CALLBACK_URL="************************************************"++# Microsoft Auth Config+MICROSOFT_CLIENT_ID="************************************************"+MICROSOFT_CLIENT_SECRET="************************************************"+MICROSOFT_CALLBACK_URL="************************************************"+MICROSOFT_SCOPE="user.read"diff --git a/packages/hoppscotch-backend/src/auth/auth.service.spec.ts b/packages/hoppscotch-backend/src/auth/auth.service.spec.tsindex 800ab6626..3a396b674 100644--- a/packages/hoppscotch-backend/src/auth/auth.service.spec.ts+++ b/packages/hoppscotch-backend/src/auth/auth.service.spec.ts@@ -1,18 +1,35 @@-import { Test, TestingModule } from '@nestjs/testing';+import { JwtService } from '@nestjs/jwt';+import { mockDeep } from 'jest-mock-extended';+import { MailerService } from 'src/mailer/mailer.service';+import { PrismaService } from 'src/prisma/prisma.service';+import { AuthUser } from 'src/types/AuthUser';+import { UserService } from 'src/user/user.service';import { AuthService } from './auth.service';-describe('AuthService', () => {- let service: AuthService;+const mockPrisma = mockDeep<PrismaService>();+const mockUser = mockDeep<UserService>();+const mockJWT = mockDeep<JwtService>();+const mockMailer = mockDeep<MailerService>();- beforeEach(async () => {- const module: TestingModule = await Test.createTestingModule({- providers: [AuthService],- }).compile();+// eslint-disable-next-line @typescript-eslint/ban-ts-comment+// @ts-ignore+const authService = new AuthService(mockUser, mockPrisma, mockJWT, mockMailer);- service = module.get<AuthService>(AuthService);- });+const currentTime = new Date();- it('should be defined', () => {- expect(service).toBeDefined();- });+const user: AuthUser = {+ uid: '123344',+ email: '[email protected]',+ displayName: 'Dwight Schrute',+ photoURL: 'https://en.wikipedia.org/wiki/Dwight_Schrute',+ isAdmin: false,+ refreshToken: 'hbfvdkhjbvkdvdfjvbnkhjb',+ createdOn: currentTime,+};++describe('signIn', () => {+ // should throw error if email is not in valid format+ // should successfully create a new user account and return the passwordless details+ // should successfully return the passwordless details for a existing user account+});