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

HTTP Basic Auth for Routes #33

Open
Anonyfox opened this issue Dec 17, 2018 · 0 comments
Open

HTTP Basic Auth for Routes #33

Anonyfox opened this issue Dec 17, 2018 · 0 comments
Labels

Comments

@Anonyfox
Copy link
Member

As a developer using the seagull framework, I want to protect some routes (but not all) of my app with http basic auth. Desired usage is within a route class like this:

import { Route } from '@seagull/routes'

export default class extends Route {
  static method = 'get'
  static path = '/'
  static auth = { basic: {[{ name: 'john', password: 'supersecret' }]} }

  async handler() {
    this.render('Index', {})
  }
}

This way, multiple name/password combinations are configurable easily. Additionally, the object used in the auth property can be imported from any module or function, thus sharing a common object between routes is easily possible if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant