Giter Site home page Giter Site logo

cornflourblue / mean-angular2-registration-login-example Goto Github PK

View Code? Open in Web Editor NEW
121.0 23.0 113.0 71 KB

MEAN Stack with Angular 2 User Registration and Login Example

Home Page: http://jasonwatmore.com/post/2017/02/22/mean-with-angular-2-user-registration-and-login-example-tutorial

License: MIT License

CSS 0.23% HTML 24.67% TypeScript 41.01% JavaScript 34.09%

mean-angular2-registration-login-example's Introduction

mean-angular2-registration-login-example's People

Contributors

cornflourblue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mean-angular2-registration-login-example's Issues

Error in middleware

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)

Not able to run client module using ng serve

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)

Show login failed error

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));
                }
            });
    }

How to run it on localhost?

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.

Maybe there is an security issue?

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!

Duplicate identifier

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 ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.