mirror of
https://github.com/Mueller-Patrick/Betterzon.git
synced 2024-11-14 18:43:57 +00:00
Merge pull request #87 from Mueller-Patrick/develop
BETTERZON-146: Session handling rewrite HOTFIX 2
This commit is contained in:
commit
ce083d8abb
|
@ -25,8 +25,8 @@ crawlingstatusRouter.get('/', async (req: Request, res: Response) => {
|
|||
try {
|
||||
// Authenticate user
|
||||
const user_ip = req.connection.remoteAddress ?? '';
|
||||
const session_id = req.params.session_id;
|
||||
const session_key = req.params.session_key;
|
||||
const session_id = (req.query.session_id ?? '').toString();
|
||||
const session_key = (req.query.session_key ?? '').toString();
|
||||
const user = await UserService.checkSession(session_id, session_key, user_ip);
|
||||
|
||||
if (!user.is_admin) {
|
||||
|
|
|
@ -24,8 +24,8 @@ favoriteshopsRouter.get('/', async (req: Request, res: Response) => {
|
|||
try {
|
||||
// Authenticate user
|
||||
const user_ip = req.connection.remoteAddress ?? '';
|
||||
const session_id = req.params.session_id;
|
||||
const session_key = req.params.session_key;
|
||||
const session_id = (req.query.session_id ?? '').toString();
|
||||
const session_key = (req.query.session_key ?? '').toString();
|
||||
const user = await UserService.checkSession(session_id, session_key, user_ip);
|
||||
|
||||
const priceAlarms = await FavoriteShopsService.getFavoriteShops(user.user_id);
|
||||
|
@ -76,8 +76,8 @@ favoriteshopsRouter.delete('/:id', async (req: Request, res: Response) => {
|
|||
try {
|
||||
// Authenticate user
|
||||
const user_ip = req.connection.remoteAddress ?? '';
|
||||
const session_id = req.params.session_id;
|
||||
const session_key = req.params.session_key;
|
||||
const session_id = (req.query.session_id ?? '').toString();
|
||||
const session_key = (req.query.session_key ?? '').toString();
|
||||
const user = await UserService.checkSession(session_id, session_key, user_ip);
|
||||
|
||||
// Get info for price alarm creation
|
||||
|
|
|
@ -24,8 +24,8 @@ pricealarmsRouter.get('/', async (req: Request, res: Response) => {
|
|||
try {
|
||||
// Authenticate user
|
||||
const user_ip = req.connection.remoteAddress ?? '';
|
||||
const session_id = req.params.session_id;
|
||||
const session_key = req.params.session_key;
|
||||
const session_id = (req.query.session_id ?? '').toString();
|
||||
const session_key = (req.query.session_key ?? '').toString();
|
||||
const user = await UserService.checkSession(session_id, session_key, user_ip);
|
||||
|
||||
const priceAlarms = await PriceAlarmsService.getPriceAlarms(user.user_id);
|
||||
|
|
4
Backend/src/models/vendors/vendors.router.ts
vendored
4
Backend/src/models/vendors/vendors.router.ts
vendored
|
@ -37,8 +37,8 @@ vendorsRouter.get('/managed', async (req: Request, res: Response) => {
|
|||
try {
|
||||
// Authenticate user
|
||||
const user_ip = req.connection.remoteAddress ?? '';
|
||||
const session_id = req.params.session_id;
|
||||
const session_key = req.params.session_key;
|
||||
const session_id = (req.query.session_id ?? '').toString();
|
||||
const session_key = (req.query.session_key ?? '').toString();
|
||||
const user = await UserService.checkSession(session_id, session_key, user_ip);
|
||||
|
||||
const vendors = await VendorService.getManagedShops(user.user_id);
|
||||
|
|
Loading…
Reference in New Issue
Block a user