Client Credentials
This commit is contained in:
parent
d272534ac7
commit
2a3ac1d1d5
4 changed files with 107 additions and 0 deletions
17
apps.go
17
apps.go
|
@ -94,3 +94,20 @@ func RegisterApp(ctx context.Context, appConfig *AppConfig) (*Application, error
|
|||
|
||||
return &app, nil
|
||||
}
|
||||
|
||||
// ApplicationVerification is mastodon application.
|
||||
type ApplicationVerification struct {
|
||||
Name string `json:"name"`
|
||||
Website string `json:"website"`
|
||||
VapidKey string `json:"vapid_key"`
|
||||
}
|
||||
|
||||
// VerifyAppCredentials returns the mastodon application.
|
||||
func (c *Client) VerifyAppCredentials(ctx context.Context) (*ApplicationVerification, error) {
|
||||
var application ApplicationVerification
|
||||
err := c.doAPI(ctx, http.MethodGet, "/api/v1/apps/verify_credentials", nil, &application, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &application, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue