Skip to content

Commit

Permalink
fix: fixed the cookie and dbConfig typo (#231)
Browse files Browse the repository at this point in the history
* fix: fixed cookie typo

* fix: added contributor name
  • Loading branch information
IgnatG authored Nov 4, 2023
1 parent a012cef commit 572dfd9
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 22 deletions.
2 changes: 2 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,5 @@
- Jonathan Felicity [https://github.com/jonathanfelicity](https://github.com/jonathanfelicity)

- Hichem Fantar [https://github.com/hichemfantar](https://github.com/hichemfantar)

- Gabriel Ignat [https://github.com/ignat](https://github.com/ignatg)
4 changes: 2 additions & 2 deletions lib/default/src/middlewares/auth.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { DataStoredInToken, RequestWithUser } from '@interfaces/auth.interface';
import { UserModel } from '@models/users.model';

const getAuthorization = req => {
const coockie = req.cookies['Authorization'];
if (coockie) return coockie;
const cookie = req.cookies['Authorization'];
if (cookie) return cookie;

const header = req.header('Authorization');
if (header) return header.split('Bearer ')[1];
Expand Down
4 changes: 2 additions & 2 deletions lib/knex/src/middlewares/auth.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { User } from '@interfaces/users.interface';
import { UserModel } from '@models/users.model';

const getAuthorization = req => {
const coockie = req.cookies['Authorization'];
if (coockie) return coockie;
const cookie = req.cookies['Authorization'];
if (cookie) return cookie;

const header = req.header('Authorization');
if (header) return header.split('Bearer ')[1];
Expand Down
4 changes: 2 additions & 2 deletions lib/mikro-orm/src/middlewares/auth.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { HttpException } from '@exceptions/httpException';
import { DataStoredInToken, RequestWithUser } from '@interfaces/auth.interface';

const getAuthorization = (req) => {
const coockie = req.cookies['Authorization'];
if (coockie) return coockie;
const cookie = req.cookies['Authorization'];
if (cookie) return cookie;

const header = req.header('Authorization');
if (header) return header.split('Bearer ')[1];
Expand Down
4 changes: 2 additions & 2 deletions lib/mongoose/src/middlewares/auth.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { DataStoredInToken, RequestWithUser } from '@interfaces/auth.interface';
import { UserModel } from '@models/users.model';

const getAuthorization = (req) => {
const coockie = req.cookies['Authorization'];
if (coockie) return coockie;
const cookie = req.cookies['Authorization'];
if (cookie) return cookie;

const header = req.header('Authorization');
if (header) return header.split('Bearer ')[1];
Expand Down
4 changes: 2 additions & 2 deletions lib/node-postgres/src/middlewares/auth.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { HttpException } from '@exceptions/httpException';
import { DataStoredInToken, RequestWithUser } from '@interfaces/auth.interface';

const getAuthorization = req => {
const coockie = req.cookies['Authorization'];
if (coockie) return coockie;
const cookie = req.cookies['Authorization'];
if (cookie) return cookie;

const header = req.header('Authorization');
if (header) return header.split('Bearer ')[1];
Expand Down
4 changes: 2 additions & 2 deletions lib/prisma/src/middlewares/auth.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { HttpException } from '@exceptions/httpException';
import { DataStoredInToken, RequestWithUser } from '@interfaces/auth.interface';

const getAuthorization = (req) => {
const coockie = req.cookies['Authorization'];
if (coockie) return coockie;
const cookie = req.cookies['Authorization'];
if (cookie) return cookie;

const header = req.header('Authorization');
if (header) return header.split('Bearer ')[1];
Expand Down
4 changes: 2 additions & 2 deletions lib/routing-controllers/src/middlewares/auth.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { DataStoredInToken, RequestWithUser } from '@interfaces/auth.interface';
import { UserModel } from '@models/users.model';

const getAuthorization = (req) => {
const coockie = req.cookies['Authorization'];
if (coockie) return coockie;
const cookie = req.cookies['Authorization'];
if (cookie) return cookie;

const header = req.header('Authorization');
if (header) return header.split('Bearer ')[1];
Expand Down
4 changes: 2 additions & 2 deletions lib/sequelize/src/middlewares/auth.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { HttpException } from '@exceptions/httpException';
import { DataStoredInToken, RequestWithUser } from '@interfaces/auth.interface';

const getAuthorization = (req) => {
const coockie = req.cookies['Authorization'];
if (coockie) return coockie;
const cookie = req.cookies['Authorization'];
if (cookie) return cookie;

const header = req.header('Authorization');
if (header) return header.split('Bearer ')[1];
Expand Down
4 changes: 2 additions & 2 deletions lib/typegoose/src/database/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { connect, set } from 'mongoose';
import { NODE_ENV, DB_HOST, DB_PORT, DB_DATABASE } from '@config';

export const dbConnection = async () => {
const dbConfing = {
const dbConfig = {
url: `mongodb://${DB_HOST}:${DB_PORT}/${DB_DATABASE}`,
options: {
useNewUrlParser: true,
Expand All @@ -14,5 +14,5 @@ export const dbConnection = async () => {
set('debug', true);
}

await connect(dbConfing);
await connect(dbConfig);
};
4 changes: 2 additions & 2 deletions lib/typegoose/src/middlewares/auth.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { DataStoredInToken, RequestWithUser } from '@interfaces/auth.interface';
import { UserModel } from '@models/users.model';

const getAuthorization = (req) => {
const coockie = req.cookies['Authorization'];
if (coockie) return coockie;
const cookie = req.cookies['Authorization'];
if (cookie) return cookie;

const header = req.header('Authorization');
if (header) return header.split('Bearer ')[1];
Expand Down
4 changes: 2 additions & 2 deletions lib/typeorm/src/middlewares/auth.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { HttpException } from '@/exceptions/httpException';
import { DataStoredInToken, RequestWithUser } from '@interfaces/auth.interface';

const getAuthorization = (req) => {
const coockie = req.cookies['Authorization'];
if (coockie) return coockie;
const cookie = req.cookies['Authorization'];
if (cookie) return cookie;

const header = req.header('Authorization');
if (header) return header.split('Bearer ')[1];
Expand Down

0 comments on commit 572dfd9

Please sign in to comment.