Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix instructor register #76

Merged
merged 2 commits into from
Sep 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ const PaymentConfirmationModal: React.FC<PaymentModalProps> = ({
</div>
</DialogHeader>
<DialogBody divider>
<Typography variant='body' className='font-semibold' color='gray'>
<Typography variant='paragraph' className='font-semibold text-md' color='gray'>
Please review the details before proceeding:
</Typography>
<Typography variant='body' color='gray' className='mt-2 mb-1'>
<Typography variant='paragraph' color='gray' className='mt-2 mb-1'>
{isFreeCourse ? (
<span className='font-semibold text-green-500'>
This course is free!
Expand All @@ -135,7 +135,7 @@ const PaymentConfirmationModal: React.FC<PaymentModalProps> = ({

)}
</Typography>
<Typography variant='body' color='gray'>
<Typography variant='paragraph' color='gray'>
<span className='font-semibold'>Course Overview:</span><br />
{courseDetails?.overview}
</Typography>
Expand Down
1 change: 1 addition & 0 deletions client/src/components/pages/course-pages/pdf-viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ interface PdfViewerProps {
}

const PdfViewer: React.FC<PdfViewerProps> = ({ pdfUrl }) => {
console.log(pdfUrl)
return (
<div>
<Document file={pdfUrl}>
Expand Down
16 changes: 9 additions & 7 deletions client/src/components/pages/course-pages/view-course.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,15 @@ const ViewCourseStudent: React.FC = () => {
{expandedIndex === 0 && (
<li className=''>
<ul>
<li
className='p-6 border-b flex items-center cursor-pointer hover:bg-customBlueShade'
onClick={handleLiClick}
>
<IoBookSharp className='mr-2 text-blue-500' />
<span className='flex-1'>Important guidelines</span>
</li>
<Link to={course?.guidelinesUrl ?? ""} target="_blank" rel="noopener noreferrer" >
<li
className='p-6 border-b flex items-center cursor-pointer hover:bg-customBlueShade'
// onClick={handleLiClick}
>
<IoBookSharp className='mr-2 text-blue-500' />
<span className='flex-1'>Important guidelines</span>
</li>
</Link>
{showPdf && (
<PdfViewer pdfUrl={course?.guidelinesUrl ?? ""} />
)}
Expand Down
1 change: 1 addition & 0 deletions server/src/adapters/controllers/courseController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ const courseController = (
cloudService,
dbRepositoryCourse
);
console.log(course)
res.status(200).json({
status: 'success',
message: 'Successfully retrieved the course',
Expand Down
16 changes: 12 additions & 4 deletions server/src/app/usecases/auth/instructorAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,23 @@
instructorRepository: ReturnType<InstructorDbInterface>,
authService: ReturnType<AuthServiceInterface>
) => {
instructor.certificates = []
console.log(instructor);

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This logs sensitive data returned by
an access to password
as clear text.
instructor.certificates = [];
instructor.profilePic = {
name: '',
key: '',
url: ''
};
if (files) {
files.map((file) => {
if (file.originalname === 'profilePic') {
instructor.profilePic.url = file.path;
instructor.profilePic.name=file.originalname
} else {
const certificate = {
name:file.originalname,
url:file.path
}
name: file.originalname,
url: file.path
};
instructor.certificates.push(certificate);
}
});
Expand All @@ -42,6 +49,7 @@
if (password) {
instructor.password = await authService.hashPassword(password);
}
console.log(instructor)

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This logs sensitive data returned by
an access to password
as clear text.
const response = await instructorRepository.addInstructor(instructor);
return response
? { status: true, message: 'successfully registered!' }
Expand Down
Loading