|
1 |
| -# Ionic Angular Auth |
| 1 | +# :zap: Ionic Angular Auth |
2 | 2 |
|
3 |
| -App to prevent access to 'members' route if user not authorized. Authorization is via email & password converted to a JWT token instead of using a backend. |
| 3 | +* App to prevent access to 'members' route if user not authorized. Authorization is via email & password converted to a JWT token instead of using a backend. |
| 4 | +* Another great tutorial from [Simon Grimm of the IonicAcademy, Youtube video 'Building an Ionic 4 JWT Login with Tab Bar & Angular Routing'](https://www.youtube.com/watch?v=lNqXCn8KacI). |
4 | 5 |
|
5 |
| -This is another great tutorial from [Simon Grimm of the IonicAcademy, Youtube video 'Building an Ionic 4 JWT Login with Tab Bar & Angular Routing'](https://www.youtube.com/watch?v=lNqXCn8KacI). |
| 6 | +## :page_facing_up: Table of contents |
6 | 7 |
|
7 |
| -## Table of contents |
| 8 | +* [:zap: Ionic Angular Auth](#zap-ionic-angular-auth) |
| 9 | + * [:page_facing_up: Table of contents](#page_facing_up-table-of-contents) |
| 10 | + * [:books: General info](#books-general-info) |
| 11 | + * [:camera: Screenshots](#camera-screenshots) |
| 12 | + * [:signal_strength: Technologies](#signal_strength-technologies) |
| 13 | + * [:floppy_disk: Setup](#floppy_disk-setup) |
| 14 | + * [:computer: Code Examples](#computer-code-examples) |
| 15 | + * [:cool: Features](#cool-features) |
| 16 | + * [:clipboard: Status & To-do list](#clipboard-status--to-do-list) |
| 17 | + * [:clap: Inspiration](#clap-inspiration) |
| 18 | + * [:envelope: Contact](#envelope-contact) |
8 | 19 |
|
9 |
| -* [General info](#general-info) |
10 |
| -* [Screenshots](#screenshots) |
11 |
| -* [Technologies](#technologies) |
12 |
| -* [Setup](#setup) |
13 |
| -* [Features](#features) |
14 |
| -* [Status](#status) |
15 |
| -* [Inspiration](#inspiration) |
16 |
| -* [Contact](#contact) |
17 |
| - |
18 |
| -## General info |
| 20 | +## :books: General info |
19 | 21 |
|
20 | 22 | * Initial screen is a login page with email and password fields. Angular 'canActivate' authguard limits access to the 'members/' route to only authorised (JWT token-bearing) users.
|
21 | 23 |
|
22 |
| -## Screenshots |
| 24 | +## :camera: Screenshots |
23 | 25 |
|
24 |
| - |
| 26 | + |
25 | 27 |
|
26 |
| -## Technologies |
| 28 | +## :signal_strength: Technologies |
27 | 29 |
|
28 |
| -* [Ionic v5.0.0](https://ionicframework.com/) |
29 |
| -* [Ionic/angular v4.7.1](https://ionicframework.com/) |
30 |
| -* [Angular v8.1.2](https://angular.io/) |
31 |
| -* [Angular RxJS Library v6.5.1](https://angular.io/guide/rx-library) Observable functions |
32 |
| -* [Angular JWT library v3.0.0](https://www.npmjs.com/package/@auth0/angular-jwt) provides an HttpInterceptor which automatically attaches a JSON Web Token to HttpClient requests. Used as a standalone JWT decoder. |
33 |
| -* [Ionic Storage v2.2.0](https://www.npmjs.com/package/@ionic/storage) key-value Storage module based on LocalForage. |
| 30 | +* [Ionic v5](https://ionicframework.com/) |
| 31 | +* [Ionic/angular v5](https://ionicframework.com/) |
| 32 | +* [Angular v10](https://angular.io/) |
| 33 | +* [Angular RxJS Library v6](https://angular.io/guide/rx-library) Observable functions |
| 34 | +* [@auth0/angular-jwt v5](https://www.npmjs.com/package/@auth0/angular-jwt) provides an HttpInterceptor which automatically attaches a JSON Web Token to HttpClient requests. |
| 35 | +* [Ionic Storage v2](https://www.npmjs.com/package/@ionic/storage) key-value Storage module based on LocalForage. |
34 | 36 |
|
35 |
| -## Setup |
| 37 | +## :floppy_disk: Setup |
36 | 38 |
|
37 | 39 | * To start the server on _localhost://8100_ type: 'ionic serve'
|
38 | 40 | * To start the server on a mobile using Ionic devapp and connected via wifi, type: 'ionic serve --devapp'
|
39 | 41 | * The Ionic DevApp was installed on an Android device from the Google Play app store.
|
40 | 42 |
|
41 |
| -## Code Examples |
| 43 | +## :computer: Code Examples |
42 | 44 |
|
43 | 45 | * canActivate function uses auth service to see if user authorized.
|
44 | 46 |
|
@@ -68,22 +70,20 @@ canActivate(route: ActivatedRouteSnapshot): Observable<boolean> {
|
68 | 70 | }
|
69 | 71 | ```
|
70 | 72 |
|
71 |
| -## Features |
| 73 | +## :cool: Features |
72 | 74 |
|
73 | 75 | * JWT token generated and stored using Ionic Storage. AuthGuard canActivate only true with this token. Token removed upon logging out.
|
74 | 76 |
|
75 |
| -## Status & To-do list |
| 77 | +## :clipboard: Status & To-do list |
76 | 78 |
|
77 | 79 | * Status: Working. tested using ionic server.
|
| 80 | +* To-do: nothing |
78 | 81 |
|
79 |
| -* To-do: change to use dummy backend random user data then change to a proper backend. Use in one of my own Ionic apps. |
80 |
| - |
81 |
| -## Inspiration |
82 |
| - |
83 |
| -[Simon Grimm of the IonicAcademy, Youtube video 'Building an Ionic 4 JWT Login with Tab Bar & Angular Routing'](https://www.youtube.com/watch?v=lNqXCn8KacI) |
| 82 | +## :clap: Inspiration |
84 | 83 |
|
85 |
| -[Written version of tutorial from Devtactic website: Building an Ionic 4 JWT Login with Tab Bar & Angular Routing](https://devdactic.com/ionic-4-jwt-login/) |
| 84 | +* [Simon Grimm of the IonicAcademy, Youtube video 'Building an Ionic 4 JWT Login with Tab Bar & Angular Routing'](https://www.youtube.com/watch?v=lNqXCn8KacI) |
| 85 | +* [Written version of tutorial from Devtactic website: Building an Ionic 4 JWT Login with Tab Bar & Angular Routing](https://devdactic.com/ionic-4-jwt-login/) |
86 | 86 |
|
87 |
| -## Contact |
| 87 | +## :envelope: Contact |
88 | 88 |
|
89 |
| -Repo created by [ABateman](https://www.andrewbateman.org) - feel free to contact me! |
| 89 | +* Repo created by [ABateman](https://www.andrewbateman.org) - you are welcome to [send me a message](https://andrewbateman.org/contact) |
0 commit comments