Skip to content

Commit 4c31a2a

Browse files
committed
Added default redirect_uri
1 parent 6158920 commit 4c31a2a

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

app-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ stackoverflow:
1616
# The clientid must be for an API Application with read-write access.
1717

1818
redirectUri: ${STACK_OVERFLOW_REDIRECT_URI}
19-
# This should redirect to your Stack Overfow for Teams route on Backstage. E.g. https://<backstage-domain>/stack-overflow-teams
19+
# If no redirectUri is specified this will return to https://<backstage-domain>/stack-overflow-teams
2020

2121
backend:
2222
# Used for enabling authentication, secret is shared by all backend plugins

plugins/stack-overflow-teams-backend/config.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ export interface Config {
4646
* RedirectUri for the OAuth Application, required to use the Stack Overflow for Teams Hub and write actions.
4747
*
4848
* This should be your Backstage application domain ending in the plugin's <StackOverflowTeamsPage /> route
49+
* If not specified this will got to your <app.baseUrl>/stack-overflow-teams
4950
*/
50-
redirectUri: string;
51+
redirectUri?: string;
5152

5253
/**
5354
* Type representing the request parameters.

plugins/stack-overflow-teams-backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "backstage-plugin-stack-overflow-teams-backend",
3-
"version": "1.0.4",
3+
"version": "1.0.5",
44
"main": "src/index.ts",
55
"types": "src/index.ts",
66
"license": "Apache-2.0",

plugins/stack-overflow-teams-backend/src/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const stackOverflowTeamsPlugin = createBackendPlugin({
2727
baseUrl: forceOriginUrl(config.getString('stackoverflow.baseUrl')),
2828
teamName: config.getOptionalString('stackoverflow.teamName'),
2929
clientId: config.getNumber('stackoverflow.clientId'),
30-
redirectUri: config.getString('stackoverflow.redirectUri'),
30+
redirectUri: config.getOptionalString('stackoverflow.redirectUri') || `${config.getString('app.baseUrl')}/stack-overflow-teams`
3131
};
3232
const stackOverflowService = await createStackOverflowService({
3333
config: stackOverflowConfig,

0 commit comments

Comments
 (0)