Skip to content

Completed test - #15

Open
react-dev-senior-level wants to merge 5 commits into
wearewiser:masterfrom
react-dev-senior-level:master
Open

react-dev-senior-level wants to merge 5 commits into
wearewiser:masterfrom
react-dev-senior-level:master

Conversation

@react-dev-senior-level

Copy link
Copy Markdown

No description provided.

@johnfedoruk johnfedoruk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated Testing:

  • Lint: fails
  • test: fails
  • coverage: fails
  • build: fails

Manual Review

  • Has no custom Angular animations
  • Good use of services
  • Has auth guards AND guest guards
  • No readme describing changes
  • Good use of forms (except password field with type=text)
  • Lazy loading modules
  • Does not validate JWT
  • Unsure about async
  • Use of local storage for a JWT is a security vulnerability!!!
  • Pretty flat directory structure.
  • Would like to see more typescript features (privacy modifiers / return types / type setting)
  • Lots of importing modules that are not used - very bad for performance
  • Lots of dependency installations for things that are clearly not used in the project
  • Could not get it to run!!!

Comment thread package.json
"@angular/platform-browser-dynamic": "^5.2.0",
"@angular/router": "^5.2.0",
"bcryptjs": "^2.4.3",
"bluebird": "^3.5.1",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not required - you're using TypeScript

Comment thread package.json
"@angular/platform-browser": "^5.2.0",
"@angular/platform-browser-dynamic": "^5.2.0",
"@angular/router": "^5.2.0",
"bcryptjs": "^2.4.3",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need a key stretching algorithm?

Comment thread package.json
"concurrently": "^3.5.1",
"cookie-parser": "^1.4.3",
"core-js": "^2.4.1",
"cors": "^2.8.4",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Comment thread package.json
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "^4.0.1",
"eslint": "^4.19.1",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not tslint? Angular has it's own linting script.

export const environment = {
production: false
production: false,
apiUrl: 'https://dev-test-service.madebywiser.com'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to see this here

logout() {
this.apiService.reset();
const route = this._router;
setTimeout(function() {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fat arrow function has this scoped - so you wouldn't need to declare a constant in order to access a class member.

setTimout(
  () => {
    this._router.navigate(['/','auth','login']);
    window.location.reload();
  }, 1500
);

const route = this._router;
setTimeout(function() {
route.navigate(['/auth/login']);
window.location.reload();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't require a reload if you've managed state properly

import * as moment from 'moment';
import { pick } from 'lodash';
import { AuthData } from '../models/auth-data.model';
import { environment } from '../../../environments/environment';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should have been passed into the module, and not imported directly. Read about the static forRoot and forChild methods on module definitions and the @Inject argument decorator.

import { HttpClient, HttpHeaders } from '@angular/common/http';
import * as moment from 'moment';
import { pick } from 'lodash';
import { AuthData } from '../models/auth-data.model';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relative paths are fragile within discrete modules and could've been avoided with the environment you were provided.


reset() {
sessionStorage.removeItem('auth_data');
localStorage.removeItem('auth_data');

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security vulnerability. Should've just stuck to sessionStorage!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants