Skip to content

Commit

Permalink
Fix slackapi#1185 Add state metadata to Installation interface
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch committed Mar 10, 2021
1 parent 95dfc59 commit 6a1cff5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/oauth/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,11 @@ export class InstallProvider {
configurationUrl: resp.incoming_webhook.configuration_url,
};
}
if (installOptions !== undefined && installOptions.metadata !== undefined) {
// Pass the metadata in state parameter if exists.
// Developers can use the value for additional/custom data associated with the installation.
installation.metadata = installOptions.metadata;
}
// End: Build the installation object

// Save installation object to installation store
Expand Down Expand Up @@ -596,6 +601,9 @@ export interface Installation<AuthVersion extends ('v1' | 'v2') = ('v1' | 'v2'),

/** The version of Slack's auth flow that produced this installation. Synthesized as `v2` when not present. */
authVersion?: AuthVersion;

/** A string value that can be held in the state parameter in the OAuth flow. */
metadata?: string;
}

/**
Expand Down

0 comments on commit 6a1cff5

Please sign in to comment.