#Can't access response.redirect

20 messages · Page 1 of 1 (latest)

exotic talon
#

I need to redirect dynamically in my controller but can't seem to access the method to do so

    @Get('return')
    @UseGuards(AuthGuard('steam'))
    steamReturn (@Req() request: Request, @Res() response: Response ) {
        const steamProfile = request.session.steamprofile;
        console.log("SteamID:", steamProfile.steamid);
        response.redirect()
        return "Success"; 
    }
#

I'm using the Res object from @nestjs/common

#

I can't import Response from express either

#

tf

tidal yacht
#

Why can't you import Response from express?

exotic talon
#

I really have no idea

tidal yacht
#

Does it change if you do import type?

#

Do you have @types/express installed?

exotic talon
#

oh wait that's probably it

#

no nvm i have that package

#

import type just creates another error

#

and import 'type' doesn't do anything

exotic talon
# exotic talon

Why does request have to be capitalized in the import when its exported like this ?

tidal yacht
#

Request and Response should be the type interfaces from the @types/express package

exotic talon
#

oh right i see

#

i had some weird @types folder