Compare commits
3 Commits
0.0.35
...
release/0.
| Author | SHA1 | Date | |
|---|---|---|---|
|
4ed4b6e5f4
|
|||
|
4499e20e77
|
|||
|
c8b1b72694
|
11
.drone.yml
11
.drone.yml
@@ -61,8 +61,7 @@ trigger:
|
|||||||
branch:
|
branch:
|
||||||
- main
|
- main
|
||||||
event:
|
event:
|
||||||
# - pull_request
|
- pull_request
|
||||||
- push
|
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
@@ -145,10 +144,7 @@ depends_on:
|
|||||||
- Test Pipeline
|
- Test Pipeline
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
# branch:
|
|
||||||
# - main
|
|
||||||
event:
|
event:
|
||||||
# - push
|
|
||||||
- tag
|
- tag
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -212,8 +208,5 @@ depends_on:
|
|||||||
- Test Pipeline
|
- Test Pipeline
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
# branch:
|
|
||||||
# - main
|
|
||||||
event:
|
event:
|
||||||
# - push
|
- promote
|
||||||
- tag
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import Auth from '../../db/model/auth';
|
|||||||
import { sign } from '../../utils/jwt';
|
import { sign } from '../../utils/jwt';
|
||||||
import passport from '../passport';
|
import passport from '../passport';
|
||||||
import { ErrorCodes, getErrorBody } from '../../constants/errors';
|
import { ErrorCodes, getErrorBody } from '../../constants/errors';
|
||||||
|
import { authenticated } from '../middleware/authenication';
|
||||||
|
|
||||||
const routerOpts: Router.IRouterOptions = { prefix };
|
const routerOpts: Router.IRouterOptions = { prefix };
|
||||||
const router: Router = new Router(routerOpts);
|
const router: Router = new Router(routerOpts);
|
||||||
@@ -43,7 +44,7 @@ router.post(process.env.RESET_ROUTE || RESET_ROUTE, async (ctx, next) => {
|
|||||||
ctx.body = { success: false, ...getErrorBody(ErrorCodes.RESET_REQUEST_DATA) };
|
ctx.body = { success: false, ...getErrorBody(ErrorCodes.RESET_REQUEST_DATA) };
|
||||||
});
|
});
|
||||||
|
|
||||||
router.patch('/:record', (ctx: Koa.Context) => {
|
router.patch('/:record', authenticated(), (ctx: Koa.Context) => {
|
||||||
const data = Auth.findOneAndUpdate({ record: ctx.params.record });
|
const data = Auth.findOneAndUpdate({ record: ctx.params.record });
|
||||||
if (!data) {
|
if (!data) {
|
||||||
ctx.throw(StatusCodes.NOT_FOUND);
|
ctx.throw(StatusCodes.NOT_FOUND);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mifi/auth",
|
"name": "@mifi/auth",
|
||||||
"version": "0.0.35",
|
"version": "0.0.37",
|
||||||
"author": "mifi (Mike Fitzpatrick)",
|
"author": "mifi (Mike Fitzpatrick)",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user