Skip to content

Commit

Permalink
Merge pull request #1187 from seratch/issue-1185-metadata-in-installa…
Browse files Browse the repository at this point in the history
…tion

Fix #1185 Add state metadata to Installation interface
  • Loading branch information
stevengill committed Mar 10, 2021
2 parents 95dfc59 + 6a1cff5 commit f3a3a37
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 f3a3a37

Please sign in to comment.