question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Session Method Parameter Decorator

See original GitHub issue

Is the @Session decorator avaible? I attach to req.session an user object after sucessfull authentication and use it in controler method to check if user is an owner of demanded object from database. It would be nice to have :

@Get("/posts")
getAll(@Session("user") user: User) {
   return postsRepository.getAllByUser(user);
}

And don’t have to parse request object by myself 😉

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
pleerockcommented, Sep 19, 2016

thanks @19majkel94 . Hope someone take care of it in koa too

0reactions
github-actions[bot]commented, Dec 17, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use python decorators for session validation
i am using session as a global variable like below. How to perform this validation using python decorators?
Read more >
Chapter 8. Decorators
A decorator implements one or more bean types and intercepts business method invocations of beans which implement those bean types. These bean types...
Read more >
Primer on Python Decorators
In this introductory tutorial, we'll look at what Python decorators are and how to create and use them.
Read more >
Custom decorators | NestJS - A progressive Node.js framework
Decorators can be defined for either a class, a method or a property. ... Nest provides a set of useful param decorators that...
Read more >
NestJS — Creating custom parameter decorators for your APIs ...
Here are five decorators that you may already have been frequently using for creating APIs: @Session , @Param , @Body , @Query and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found