Skip to content

Commit 80d697f

Browse files
authored
Merge pull request #4 from reddimohan/dev
Dev
2 parents 486f3dc + 6953ae4 commit 80d697f

File tree

5 files changed

+184
-6
lines changed

5 files changed

+184
-6
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Reddi Mohan A
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 163 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,168 @@
1-
# api
1+
[![Contributors][contributors-shield]][contributors-url]
2+
[![Forks][forks-shield]][forks-url]
3+
[![Stargazers][stars-shield]][stars-url]
4+
[![Issues][issues-shield]][issues-url]
5+
[![MIT License][license-shield]][license-url]
6+
[![LinkedIn][linkedin-shield]][linkedin-url]
27

3-
git clone
8+
9+
10+
<!-- PROJECT LOGO -->
11+
<br />
12+
<p align="center">
13+
<a href="https://github.com/reddimohan/loopback4-authentication-jwt-roles">
14+
</a>
15+
16+
<h3 align="center">Loopback 4 JWT Authentication with Roles</h3>
17+
18+
<p align="center">
19+
Loopback 4 Boilerplate code for quick implimentation of Authentication and Roles based on JWT.
20+
<br />
21+
<br />
22+
<a href="https://github.com/reddimohan/loopback4-authentication-jwt-roles">View Demo</a>
23+
·
24+
<a href="https://github.com/reddimohan/loopback4-authentication-jwt-roles/issues">Report Bug</a>
25+
</p>
26+
</p>
27+
28+
29+
30+
<!-- TABLE OF CONTENTS -->
31+
## Table of Contents
32+
33+
* [About the Project](#about-the-project)
34+
* [Built With](#built-with)
35+
* [Getting Started](#getting-started)
36+
* [Prerequisites](#prerequisites)
37+
* [Installation](#installation)
38+
* [Roadmap](#roadmap)
39+
* [Contributing](#contributing)
40+
* [License](#license)
41+
* [Contact](#contact)
42+
43+
44+
45+
<!-- ABOUT THE PROJECT -->
46+
## About The Project
47+
48+
[![https://reddimohan.github.io][product-screenshot-1]]()
49+
### API Docs
50+
[![https://reddimohan.github.io][product-screenshot-2]]()
51+
52+
### Built With
53+
54+
* [Loopback 4](https://loopback.io/doc/en/lb4)
55+
* [MySQL](https://www.mysql.com)
56+
* [jwt](https://jwt.io)
57+
58+
59+
60+
<!-- GETTING STARTED -->
61+
## Getting Started
62+
63+
To get a local copy up and running follow these simple steps.
64+
65+
### Prerequisites
66+
67+
This is an example of how to list things you need to use the software and how to install them.
68+
* node.js, npm
69+
70+
```sh
71+
npm install npm@latest -g
72+
```
73+
74+
### Installation
75+
76+
1. Clone the repo
77+
```sh
78+
git clone https://github.com/reddimohan/loopback4-authentication-jwt-roles.git
79+
```
80+
2. Install NPM packages
81+
```sh
482
npm install
5-
update db details in src/datasources/mysql.datasource.config.json
83+
```
84+
3. Create a database (MySQL)
85+
4. Update database details in src/datasources/mysql.datasource.config.json file
86+
```sh
87+
{
88+
"name": "mysql",
89+
"connector": "mysql",
90+
"url": "",
91+
"host": "localhost",
92+
"port": 3306,
93+
"user": "<username>",
94+
"password": "<password>",
95+
"database": "<db_name>"
96+
}
97+
```
98+
5. Migrade database schema
99+
```sh
6100
npm run build
7101
num run migrate
102+
```
103+
6. Start the application
104+
```sh
105+
npm start
106+
```
107+
7. Install Loopback 4 CLI - This will be useful when you want to start developing on top this repo
108+
```sh
109+
npm install -g @loopback/cli
110+
```
111+
112+
113+
<!-- ROADMAP -->
114+
## Roadmap
115+
116+
See the [open issues](https://github.com/reddimohan/loopback4-authentication-jwt-roles/issues) for a list of proposed features (and known issues).
117+
118+
119+
120+
<!-- CONTRIBUTING -->
121+
## Contributing
122+
123+
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.
124+
125+
1. Fork the Project
126+
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
127+
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
128+
4. Push to the Branch (`git push origin feature/AmazingFeature`)
129+
5. Open a Pull Request
130+
131+
132+
133+
<!-- LICENSE -->
134+
## License
135+
136+
Distributed under the MIT License. See `LICENSE` for more information.
137+
138+
139+
140+
<!-- CONTACT -->
141+
## Contact
142+
143+
Mohan - [LinkedIn](https://linkedin.com/in/reddimohan) - [Twitter](https://twitter.com/reddimohan)
144+
145+
Project Link: [https://github.com/reddimohan/loopback4-authentication-jwt-roles](https://github.com/reddimohan/loopback4-authentication-jwt-roles)
146+
147+
148+
149+
150+
151+
8152

9-
[![LoopBack](https://github.com/strongloop/loopback-next/raw/master/docs/site/imgs/branding/Powered-by-LoopBack-Badge-(blue)-@2x.png)](http://loopback.io/)
10-
# loopback4-authentication-jwt-roles
153+
<!-- MARKDOWN LINKS & IMAGES -->
154+
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
155+
[contributors-shield]: https://img.shields.io/github/contributors/reddimohan/loopback4-authentication-jwt-roles.svg?style=flat-square
156+
[contributors-url]: https://github.com/reddimohan/loopback4-authentication-jwt-roles/graphs/contributors
157+
[forks-shield]: https://img.shields.io/github/forks/reddimohan/loopback4-authentication-jwt-roles.svg?style=flat-square
158+
[forks-url]: https://github.com/reddimohan/loopback4-authentication-jwt-roles/network/members
159+
[stars-shield]: https://img.shields.io/github/stars/reddimohan/loopback4-authentication-jwt-roles.svg?style=flat-square
160+
[stars-url]: https://github.com/reddimohan/loopback4-authentication-jwt-roles/stargazers
161+
[issues-shield]: https://img.shields.io/github/issues/reddimohan/loopback4-authentication-jwt-roles.svg?style=flat-square
162+
[issues-url]: https://github.com/reddimohan/loopback4-authentication-jwt-roles/issues
163+
[license-shield]: https://img.shields.io/github/license/reddimohan/loopback4-authentication-jwt-roles.svg?style=flat-square
164+
[license-url]: https://github.com/reddimohan/loopback4-authentication-jwt-roles/blob/master/LICENSE
165+
[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square&logo=linkedin&colorB=555
166+
[linkedin-url]: https://linkedin.com/in/reddimohan
167+
[product-screenshot-1]: images/home.png
168+
[product-screenshot-2]: images/api_docs.png

images/api_docs.png

164 KB
Loading

images/home.png

31.2 KB
Loading

src/controllers/user.controller.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export class UserController {
4444
public jwtService: JWTService,
4545
) { }
4646

47-
@authenticate('jwt', { required: [PermissionKeys.UserManagement] })
4847
@post('/users/signup', {
4948
responses: {
5049
'200': {

0 commit comments

Comments
 (0)