mirror of
https://github.com/Mueller-Patrick/Betterzon.git
synced 2024-11-10 00:23:58 +00:00
BETTERZON-146: Session handling rewrite HOTFIX 2
This commit is contained in:
parent
1fd115c2a2
commit
0cd1213c40
|
@ -25,8 +25,8 @@ crawlingstatusRouter.get('/', async (req: Request, res: Response) => {
|
||||||
try {
|
try {
|
||||||
// Authenticate user
|
// Authenticate user
|
||||||
const user_ip = req.connection.remoteAddress ?? '';
|
const user_ip = req.connection.remoteAddress ?? '';
|
||||||
const session_id = req.params.session_id;
|
const session_id = (req.query.session_id ?? '').toString();
|
||||||
const session_key = req.params.session_key;
|
const session_key = (req.query.session_key ?? '').toString();
|
||||||
const user = await UserService.checkSession(session_id, session_key, user_ip);
|
const user = await UserService.checkSession(session_id, session_key, user_ip);
|
||||||
|
|
||||||
if (!user.is_admin) {
|
if (!user.is_admin) {
|
||||||
|
|
|
@ -24,8 +24,8 @@ favoriteshopsRouter.get('/', async (req: Request, res: Response) => {
|
||||||
try {
|
try {
|
||||||
// Authenticate user
|
// Authenticate user
|
||||||
const user_ip = req.connection.remoteAddress ?? '';
|
const user_ip = req.connection.remoteAddress ?? '';
|
||||||
const session_id = req.params.session_id;
|
const session_id = (req.query.session_id ?? '').toString();
|
||||||
const session_key = req.params.session_key;
|
const session_key = (req.query.session_key ?? '').toString();
|
||||||
const user = await UserService.checkSession(session_id, session_key, user_ip);
|
const user = await UserService.checkSession(session_id, session_key, user_ip);
|
||||||
|
|
||||||
const priceAlarms = await FavoriteShopsService.getFavoriteShops(user.user_id);
|
const priceAlarms = await FavoriteShopsService.getFavoriteShops(user.user_id);
|
||||||
|
@ -76,8 +76,8 @@ favoriteshopsRouter.delete('/:id', async (req: Request, res: Response) => {
|
||||||
try {
|
try {
|
||||||
// Authenticate user
|
// Authenticate user
|
||||||
const user_ip = req.connection.remoteAddress ?? '';
|
const user_ip = req.connection.remoteAddress ?? '';
|
||||||
const session_id = req.params.session_id;
|
const session_id = (req.query.session_id ?? '').toString();
|
||||||
const session_key = req.params.session_key;
|
const session_key = (req.query.session_key ?? '').toString();
|
||||||
const user = await UserService.checkSession(session_id, session_key, user_ip);
|
const user = await UserService.checkSession(session_id, session_key, user_ip);
|
||||||
|
|
||||||
// Get info for price alarm creation
|
// Get info for price alarm creation
|
||||||
|
|
|
@ -24,8 +24,8 @@ pricealarmsRouter.get('/', async (req: Request, res: Response) => {
|
||||||
try {
|
try {
|
||||||
// Authenticate user
|
// Authenticate user
|
||||||
const user_ip = req.connection.remoteAddress ?? '';
|
const user_ip = req.connection.remoteAddress ?? '';
|
||||||
const session_id = req.params.session_id;
|
const session_id = (req.query.session_id ?? '').toString();
|
||||||
const session_key = req.params.session_key;
|
const session_key = (req.query.session_key ?? '').toString();
|
||||||
const user = await UserService.checkSession(session_id, session_key, user_ip);
|
const user = await UserService.checkSession(session_id, session_key, user_ip);
|
||||||
|
|
||||||
const priceAlarms = await PriceAlarmsService.getPriceAlarms(user.user_id);
|
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 {
|
try {
|
||||||
// Authenticate user
|
// Authenticate user
|
||||||
const user_ip = req.connection.remoteAddress ?? '';
|
const user_ip = req.connection.remoteAddress ?? '';
|
||||||
const session_id = req.params.session_id;
|
const session_id = (req.query.session_id ?? '').toString();
|
||||||
const session_key = req.params.session_key;
|
const session_key = (req.query.session_key ?? '').toString();
|
||||||
const user = await UserService.checkSession(session_id, session_key, user_ip);
|
const user = await UserService.checkSession(session_id, session_key, user_ip);
|
||||||
|
|
||||||
const vendors = await VendorService.getManagedShops(user.user_id);
|
const vendors = await VendorService.getManagedShops(user.user_id);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user