Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Sessions] Allow to specify the store name in a configuration file #725

Closed
LoicPoullain opened this issue May 27, 2020 · 1 comment
Closed

Comments

@LoicPoullain
Copy link
Member

LoicPoullain commented May 27, 2020

Problems

  • Having to specify the session store class every time in the hook @TokenRequired is tedious and reduce the readability of the overall code.
  • This architecture does allow to easily switch an application to another session store.
  • In the documentation, we always have to specify a session store such as TypeORMStore even if using TypeORM is not required.

Solution

Allow to specify the store in a configuration file.

Example

Before

@TokenRequired({ store: TypeORMStore })
export class ApiController {
  // ...
}

default.yml

settings:
  session:
    store: '@foal/typeorm'

After

@TokenRequired()
export class ApiController {
  // ...
}
@LoicPoullain LoicPoullain added this to To Do in Issue tracking May 27, 2020
@LoicPoullain LoicPoullain changed the title [Sessions] Allow to specify the store in a configuration file [Sessions] Allow to specify the store name in a configuration file May 28, 2020
@LoicPoullain LoicPoullain moved this from To Do to Work In Progress in Issue tracking May 28, 2020
@LoicPoullain
Copy link
Member Author

Resolved in v1.10.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Issue tracking
  
Done / Closed This Release
Development

No branches or pull requests

1 participant