mirror of
https://github.com/miniflux/v2.git
synced 2025-09-15 18:57:04 +00:00
Offer the possibility to set Pocket Consumer Key as environment variable
This commit is contained in:
parent
44decae557
commit
b270159aae
10 changed files with 31 additions and 19 deletions
|
@ -47,7 +47,7 @@ func (c *Controller) SaveEntry(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
go func() {
|
||||
integration.SendEntry(entry, settings)
|
||||
integration.SendEntry(c.cfg, entry, settings)
|
||||
}()
|
||||
|
||||
json.Created(w, map[string]string{"message": "saved"})
|
||||
|
|
|
@ -33,7 +33,7 @@ func (c *Controller) PocketAuthorize(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
sess := session.New(c.store, ctx)
|
||||
connector := pocket.NewConnector(integration.PocketConsumerKey)
|
||||
connector := pocket.NewConnector(c.cfg.PocketConsumerKey(integration.PocketConsumerKey))
|
||||
redirectURL := c.cfg.BaseURL() + route.Path(c.router, "pocketCallback")
|
||||
requestToken, err := connector.RequestToken(redirectURL)
|
||||
if err != nil {
|
||||
|
@ -64,7 +64,7 @@ func (c *Controller) PocketCallback(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
connector := pocket.NewConnector(integration.PocketConsumerKey)
|
||||
connector := pocket.NewConnector(c.cfg.PocketConsumerKey(integration.PocketConsumerKey))
|
||||
accessToken, err := connector.AccessToken(ctx.PocketRequestToken())
|
||||
if err != nil {
|
||||
logger.Error("[Pocket:Callback] %v", err)
|
||||
|
|
|
@ -61,6 +61,7 @@ func (c *Controller) ShowIntegrations(w http.ResponseWriter, r *http.Request) {
|
|||
view.Set("menu", "settings")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", c.store.CountUnreadEntries(user.ID))
|
||||
view.Set("hasPocketConsumerKeyConfigured", c.cfg.PocketConsumerKey("") != "")
|
||||
|
||||
html.OK(w, view.Render("integrations"))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue