mirror of
https://github.com/getAlby/hub.git
synced 2026-08-13 12:33:39 +02:00
chore: rename app name parameter (#154)
* chore: rename app name parameter * doc: replace all instances of `c` parameter with `name` in README
This commit is contained in:
parent
91c404c030
commit
6be8c413f1
2 changed files with 9 additions and 5 deletions
|
|
@ -67,17 +67,17 @@ The default option is that the NWC app creates a secret and the user uses the no
|
|||
|
||||
##### Query parameter options
|
||||
|
||||
- `c`: the name of the client app
|
||||
- `name`: the name of the client app
|
||||
|
||||
Example:
|
||||
|
||||
`/apps/new?c=myapp`
|
||||
`/apps/new?name=myapp`
|
||||
|
||||
#### Client created secret
|
||||
If the client creates the secret the client only needs to share the public key of that secret for authorization. The user authorized that pubkey and no sensitivate data needs to be shared.
|
||||
|
||||
##### Query parameter options for /new
|
||||
- `c`: the name of the client app
|
||||
- `name`: the name of the client app
|
||||
- `pubkey`: the public key of the client's secret for the user to authorize
|
||||
- `return_to`: (optional) if a `return_to` URL is provided the user will be redirected to that URL after authorization. The `lud16`, `relay` and `pubkey` query parameters will be added to the URL.
|
||||
- `expires_at` (optional) connection cannot be used after this date. Unix timestamp in seconds.
|
||||
|
|
@ -88,7 +88,7 @@ If the client creates the secret the client only needs to share the public key o
|
|||
|
||||
Example:
|
||||
|
||||
`/apps/new?c=myapp&pubkey=47c5a21...&return_to=https://example.com`
|
||||
`/apps/new?name=myapp&pubkey=47c5a21...&return_to=https://example.com`
|
||||
|
||||
#### Web-flow: client created secret
|
||||
Web clients can open a new prompt popup to load the authorization page.
|
||||
|
|
|
|||
|
|
@ -237,7 +237,11 @@ func getEndOfBudgetString(endOfBudget time.Time) (result string) {
|
|||
}
|
||||
|
||||
func (svc *Service) AppsNewHandler(c echo.Context) error {
|
||||
appName := c.QueryParam("c") // c - for client
|
||||
appName := c.QueryParam("name")
|
||||
if (appName == "") {
|
||||
// c - for client (deprecated)
|
||||
appName = c.QueryParam("c")
|
||||
}
|
||||
pubkey := c.QueryParam("pubkey")
|
||||
returnTo := c.QueryParam("return_to")
|
||||
maxAmount := c.QueryParam("max_amount")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue