chore: updated .env.example file with new data
This commit is contained in:
@@ -7,12 +7,13 @@ POSTMARK_SENDER_EMAIL=************************************************"
|
||||
|
||||
# Auth Tokens Config
|
||||
JWT_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 Config
|
||||
APP_DOMAIN="************************************************""
|
||||
REDIRECT_URL="************************************************""
|
||||
WHITELISTED_ORIGINS ="************************************************"
|
||||
|
||||
# Google Auth Config
|
||||
GOOGLE_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"
|
||||
|
||||
@@ -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: '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
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user