From 1579e047b51447a56d058ef62a8d2584f5d3fa27 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 21 Aug 2021 22:46:33 -0500 Subject: [PATCH] Add displayName, use as app name --- app/soapbox/actions/auth.js | 8 ++------ app/soapbox/features/admin/index.js | 2 +- app/soapbox/features/ui/components/link_footer.js | 2 +- app/soapbox/utils/code.js | 1 + package.json | 1 + 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/soapbox/actions/auth.js b/app/soapbox/actions/auth.js index 49e02725b..b4dd3d4dc 100644 --- a/app/soapbox/actions/auth.js +++ b/app/soapbox/actions/auth.js @@ -7,6 +7,7 @@ import { fetchMeSuccess, fetchMeFail } from 'soapbox/actions/me'; import { getLoggedInAccount, parseBaseURL } from 'soapbox/utils/auth'; import { createApp } from 'soapbox/actions/apps'; import { obtainOAuthToken, revokeOAuthToken } from 'soapbox/actions/oauth'; +import sourceCode from 'soapbox/utils/code'; export const SWITCH_ACCOUNT = 'SWITCH_ACCOUNT'; @@ -50,15 +51,10 @@ function createAppAndToken() { }; } -const appName = () => { - const timestamp = (new Date()).toISOString(); - return `SoapboxFE_${timestamp}`; // TODO: Add commit hash -}; - function createAuthApp() { return (dispatch, getState) => { const params = { - client_name: appName(), + client_name: sourceCode.displayName, redirect_uris: 'urn:ietf:wg:oauth:2.0:oob', scopes: 'read write follow push admin', }; diff --git a/app/soapbox/features/admin/index.js b/app/soapbox/features/admin/index.js index 0c2d90781..029448310 100644 --- a/app/soapbox/features/admin/index.js +++ b/app/soapbox/features/admin/index.js @@ -138,7 +138,7 @@ class Dashboard extends ImmutablePureComponent {

diff --git a/app/soapbox/features/ui/components/link_footer.js b/app/soapbox/features/ui/components/link_footer.js index 6e2d864fa..46b84a27c 100644 --- a/app/soapbox/features/ui/components/link_footer.js +++ b/app/soapbox/features/ui/components/link_footer.js @@ -50,7 +50,7 @@ const LinkFooter = ({ onOpenHotkeys, account, onClickLogOut }) => ( id='getting_started.open_source_notice' defaultMessage='{code_name} is open source software. You can contribute or report issues at {code_link} (v{code_version}).' values={{ - code_name: sourceCode.name, + code_name: sourceCode.displayName, code_link: {sourceCode.repository}, code_version: sourceCode.version, }} diff --git a/app/soapbox/utils/code.js b/app/soapbox/utils/code.js index b9d33ccec..9e7237066 100644 --- a/app/soapbox/utils/code.js +++ b/app/soapbox/utils/code.js @@ -33,6 +33,7 @@ const version = pkg => { module.exports = { name: pkg.name, + displayName: pkg.displayName, url: pkg.repository.url, repository: shortRepoName(pkg.repository.url), version: version(pkg), diff --git a/package.json b/package.json index 0386a3b1b..cc252e867 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "soapbox-fe", + "displayName": "Soapbox FE", "version": "1.3.0", "description": "Soapbox frontend for Pleroma.", "homepage": "https://soapbox.pub/",