Giter Site home page Giter Site logo

client-app-ua's Introduction

AngularNgrx

This project was generated with Angular CLI version 12.2.12.

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI Overview and Command Reference page.

client-app-ua's People

Contributors

bishko86 avatar

Watchers

 avatar

client-app-ua's Issues

Add accessToken to Headers

Add to interceptor method that adds to each request accessToken.
To req headers add Authorization field where value is 'Bearer ...token...'

example:
addAccessTokenToHeader(req: HttpRequest, accessToken: string) {
return req.clone({
setHeaders: {
Authorization: Bearer ${accessToken}
}
});
}

We should send refreshToken in refresh() method when a client gets status code 401 unauthorized on the specific request.
Then system sends the GET request to '/refresh/refreshToken' URL, and if the response status is 200, then restore the previous request
Add to interceptor such method.

1.0

1.0 milestone

Add Username input field

Add Username input field to login and registration forms
image
Add fiel to the top of form
Add username property to formData and sent this data to API

Create a Welcome Page

If the user clicks on the email’s confirmation link, they will find a blank page and still be unable to log in. Therefore, we need to make some changes on the front end to complete the registration procedure.

We have to add a new method in auth.service.js to call the endpoint defined in the last step.

Code example:
image
Add verifyUser() method to auth.service.js to establish the connection with the backend

After this, we have to create a new component to render when the confirmation URL is clicked. Don’t forget to include the respective route in the App file!
See here more detailed description:
https://betterprogramming.pub/how-to-create-a-signup-confirmation-email-with-node-js-c2fea602872a

Page up button

Go to the Photo tab.
On the photo tab scroll down the page on the whole height
Then on the right side must appear the Page up button
By press, it page should scroll to the top position
When the page is on the top, the Page up button should be hidden

Create the Confirmation Route

We have to set up a route to change the user status from “Pending” to “Active.”
Include a new route in the routes/auth.routes.js file and configured a new controller to deal with the procedure. The verifyUser controller searches the database for a user with the confirmationCode received in the URL and executes the status update accordingly.

code example:

image

Endpoint defined to deal with the user verification process

image

Attach cookies to response

Attach refreshToken to response cookies
You need to send refeshToken by cookies after each login and after each refresh request
Add refresh method to user.controller

Refactor authMiddleware
Refactor roleMiddleware

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.