feat: serve the quiz API under /_quizzes/api/v1 behind jwt.auth
This commit is contained in:
25
plugin.go
25
plugin.go
@@ -32,13 +32,28 @@ var langFS embed.FS
|
||||
var mailFS embed.FS
|
||||
|
||||
// Plugin is the golem15.quizzes plugin.
|
||||
type Plugin struct{}
|
||||
type Plugin struct {
|
||||
app *backpack.App
|
||||
}
|
||||
|
||||
func (p *Plugin) ID() string { return "golem15.quizzes" }
|
||||
func (p *Plugin) Requires() []string { return nil }
|
||||
func (p *Plugin) ID() string { return "golem15.quizzes" }
|
||||
|
||||
func (p *Plugin) Register(*backpack.App) error { return nil }
|
||||
func (p *Plugin) Boot(*backpack.App) error { return nil }
|
||||
// Requires golem15.user: the API runs behind its jwt.auth middleware and
|
||||
// attempts reference its users table.
|
||||
func (p *Plugin) Requires() []string { return []string{"golem15.user"} }
|
||||
|
||||
// Register keeps the application, so route handlers and commands can reach
|
||||
// its services, such as the database, when they run.
|
||||
func (p *Plugin) Register(app *backpack.App) error {
|
||||
p.app = app
|
||||
return nil
|
||||
}
|
||||
|
||||
// Boot keeps the application.
|
||||
func (p *Plugin) Boot(app *backpack.App) error {
|
||||
p.app = app
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *Plugin) ConfigFS() fs.FS { return configFS }
|
||||
func (p *Plugin) LangFS() fs.FS { return langFS }
|
||||
|
||||
Reference in New Issue
Block a user