MEAN Stack with Angular 2 - User Registration and Login Example & Tutorial
For details and documentation go to http://jasonwatmore.com/post/2017/02/22/mean-with-angular-2-user-registration-and-login-example-tutorial
MEAN Stack with Angular 2 User Registration and Login Example
License: MIT License
MEAN Stack with Angular 2 - User Registration and Login Example & Tutorial
For details and documentation go to http://jasonwatmore.com/post/2017/02/22/mean-with-angular-2-user-registration-and-login-example-tutorial
i got error in the middle ware while running node server.js
Error
at middleware (/home/../Desktop/testApp/server/node_modules/express-jwt/lib/index.js:80:21)
Here is error
Cannot read property 'config' of null
TypeError: Cannot read property 'config' of null
at Class.run (/Users/alpeshpatel/workspace/javascript/gcrawler/client/node_modules/@angular/cli/tasks/serve.js:51:63)
at check_port_1.checkPort.then.port (/Users/alpeshpatel/workspace/javascript/gcrawler/client/node_modules/@angular/cli/commands/serve.js:123:26)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
Hi,
Great tutorial thanks for it.
I have an issue to display the error if user email or password is incorrect.
Please let me know how should I fix it?
in user authentication service I'm getting this response from the server, how can I pass this response to alert service, I see you are passing response when the user logged in successfully but not if user put invalid email.
Response {_body: "{"error":"Invalid email."}", status: 200, ok: true, statusText: "OK", headers: Headers…}
login(email: string, password: string) {
return this.http.post(this.config.apiUrl + '/api/users/login', { email: email, password: password })
.map((response: Response) => {
console.log('resonse',response);
// login successful if there's a jwt token in the response
let user = response.json();
if (user && user.token) {
// store user details and jwt token in local storage to keep user logged in between page refreshes
localStorage.setItem('currentUser', JSON.stringify(user));
}
});
}
I have no idea how to run it.
It is separated as server side and client side so Do I have to npm install 2 times?
And then what should be next step to run it wihtout any issue?
Please help me.
In function update(req, res) from /server/controllers/users.controller.js , you pass req.params._id to the userService, but never check whether req.params._id === req.user.sub. Maybe Peter can use his token to update Mary's data by http.put(this.config.apiUrl + '/users/' + Mary's _id, Peter's jwt).
Thank you for your great tutorial!I am a new hand and your tutorial help me a lot!
I ve integrated your backend and i am having these kinda issues when i npm start
my angular 2 app.
node_modules/@types/node/index.d.ts(102,6): error TS2300: Duplicate identifier 'BufferEncoding'. node_modules/@types/node/index.d.ts(588,26): error TS2300: Duplicate identifier 'Buffer'. node_modules/@types/node/index.d.ts(588,50): error TS2300: Duplicate identifier 'SlowBuffer'. node_modules/@types/node/index.d.ts(777,18): error TS2300: Duplicate identifier 'Agent'. node_modules/@types/node/index.d.ts(835,18): error TS2300: Duplicate identifier 'Worker'. node_modules/@types/node/index.d.ts(1525,17): error TS2300: Duplicate identifier 'CompleterResult'. node_modules/@types/node/index.d.ts(1562,18): error TS2300: Duplicate identifier 'Script'. node_modules/@types/node/index.d.ts(2951,18): error TS2300: Duplicate identifier 'TLSSocket'. node_modules/@types/node/index.d.ts(3736,5): error TS2300: Duplicate identifier 'export='. node_modules/@types/node/index.d.ts(3758,18): error TS2300: Duplicate identifier 'Domain'. server/node_modules/base64url/typings/globals/node/index.d.ts(78,6): error TS2300: Duplicate identifier 'BufferEncoding'. server/node_modules/base64url/typings/globals/node/index.d.ts(505,26): error TS2300: Duplicate identifier 'Buffer'. server/node_modules/base64url/typings/globals/node/index.d.ts(505,50): error TS2300: Duplicate identifier 'SlowBuffer'. server/node_modules/base64url/typings/globals/node/index.d.ts(682,18): error TS2300: Duplicate identifier 'Agent'. server/node_modules/base64url/typings/globals/node/index.d.ts(727,18): error TS2300: Duplicate identifier 'Worker'. server/node_modules/base64url/typings/globals/node/index.d.ts(980,22): error TS2300: Duplicate identifier 'CompleterResult'. server/node_modules/base64url/typings/globals/node/index.d.ts(1020,18): error TS2300: Duplicate identifier 'Script'. server/node_modules/base64url/typings/globals/node/index.d.ts(1859,18): error TS2300: Duplicate identifier 'TLSSocket'. server/node_modules/base64url/typings/globals/node/index.d.ts(2299,5): error TS2300: Duplicate identifier 'export='. server/node_modules/base64url/typings/globals/node/index.d.ts(2321,18): error TS2300: Duplicate identifier 'Domain'. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] start:
tsc && concurrently "npm run tsc:w" "npm run lite" npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I am assuming this is due to having two node_modules
directories in my project. Any clues ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.