chore: updated .env.example file with new data

This commit is contained in:
Balu Babu
2023-01-20 15:00:54 +05:30
parent f79070fe60
commit ee3fbabece
2 changed files with 38 additions and 14 deletions

View File

@@ -7,12 +7,13 @@ POSTMARK_SENDER_EMAIL=************************************************"
# Auth Tokens Config # Auth Tokens Config
JWT_SECRET='add some secret here' JWT_SECRET='add some secret here'
REFRESH_TOKEN_VALIDITY="168h" # Default validity is 7 days REFRESH_TOKEN_VALIDITY="604800000" # Default validity is 7 days
ACCESS_TOKEN_VALIDITY="30s" # Default validity is 1 day ACCESS_TOKEN_VALIDITY="120000" # Default validity is 1 day
# Hoppscotch App Domain Config # Hoppscotch App Domain Config
APP_DOMAIN="************************************************"" APP_DOMAIN="************************************************""
REDIRECT_URL="************************************************"" REDIRECT_URL="************************************************""
WHITELISTED_ORIGINS ="************************************************"
# Google Auth Config # Google Auth Config
GOOGLE_CLIENT_ID="************************************************" GOOGLE_CLIENT_ID="************************************************"
@@ -24,3 +25,9 @@ GOOGLE_SCOPE= ['email', 'profile'],
GITHUB_CLIENT_ID="************************************************" GITHUB_CLIENT_ID="************************************************"
GITHUB_CLIENT_SECRET="************************************************" GITHUB_CLIENT_SECRET="************************************************"
GITHUB_CALLBACK_URL="************************************************" GITHUB_CALLBACK_URL="************************************************"
# Microsoft Auth Config
MICROSOFT_CLIENT_ID="************************************************"
MICROSOFT_CLIENT_SECRET="************************************************"
MICROSOFT_CALLBACK_URL="************************************************"
MICROSOFT_SCOPE="user.read"

View File

@@ -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'; import { AuthService } from './auth.service';
describe('AuthService', () => { const mockPrisma = mockDeep<PrismaService>();
let service: AuthService; const mockUser = mockDeep<UserService>();
const mockJWT = mockDeep<JwtService>();
const mockMailer = mockDeep<MailerService>();
beforeEach(async () => { // eslint-disable-next-line @typescript-eslint/ban-ts-comment
const module: TestingModule = await Test.createTestingModule({ // @ts-ignore
providers: [AuthService], const authService = new AuthService(mockUser, mockPrisma, mockJWT, mockMailer);
}).compile();
service = module.get<AuthService>(AuthService); const currentTime = new Date();
});
it('should be defined', () => { const user: AuthUser = {
expect(service).toBeDefined(); uid: '123344',
}); email: 'dwight@dundermifflin.com',
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
}); });