Skip to content

Commit 1804bb0

Browse files
committed
feat: encrypt token on disk using safe storage api
Signed-off-by: Adam Setch <[email protected]>
1 parent 613599e commit 1804bb0

File tree

6 files changed

+24
-22
lines changed

6 files changed

+24
-22
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"protocols": [
8484
{
8585
"name": "Gitify",
86-
"schemes": ["gitify"]
86+
"schemes": ["gitify", "gitify-dev"]
8787
}
8888
],
8989
"mac": {

src/main/main.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ const menuBuilder = new MenuBuilder(mb);
3838
const contextMenu = menuBuilder.buildMenu();
3939

4040
// Register your app as the handler for a custom protocol
41-
app.setAsDefaultProtocolClient('gitify');
41+
const protocolName =
42+
process.env.NODE_ENV === 'development' ? 'gitify-dev' : 'gitify';
43+
app.setAsDefaultProtocolClient(protocolName);
4244

4345
if (isMacOS() || isWindows()) {
4446
/**

src/renderer/context/App.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ describe('renderer/context/App.tsx', () => {
237237
expect(apiRequestAuthMock).toHaveBeenCalledWith(
238238
'https://api.github.com/user',
239239
'GET',
240-
'123-456',
240+
'encrypted',
241241
);
242242
});
243243
});

src/renderer/utils/api/__snapshots__/client.test.ts.snap

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/renderer/utils/api/__snapshots__/request.test.ts.snap

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/renderer/utils/auth/utils.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ describe('renderer/utils/auth/utils.ts', () => {
191191
hostname: 'github.com' as Hostname,
192192
method: 'Personal Access Token',
193193
platform: 'GitHub Cloud',
194-
token: '123-456' as Token,
194+
token: 'encrypted' as Token,
195195
user: mockGitifyUser,
196196
version: 'latest',
197197
},
@@ -211,7 +211,7 @@ describe('renderer/utils/auth/utils.ts', () => {
211211
hostname: 'github.com' as Hostname,
212212
method: 'OAuth App',
213213
platform: 'GitHub Cloud',
214-
token: '123-456' as Token,
214+
token: 'encrypted' as Token,
215215
user: mockGitifyUser,
216216
version: 'latest',
217217
},
@@ -243,7 +243,7 @@ describe('renderer/utils/auth/utils.ts', () => {
243243
hostname: 'github.gitify.io' as Hostname,
244244
method: 'Personal Access Token',
245245
platform: 'GitHub Enterprise Server',
246-
token: '123-456' as Token,
246+
token: 'encrypted' as Token,
247247
user: mockGitifyUser,
248248
version: '3.0.0',
249249
},
@@ -263,7 +263,7 @@ describe('renderer/utils/auth/utils.ts', () => {
263263
hostname: 'github.gitify.io' as Hostname,
264264
method: 'OAuth App',
265265
platform: 'GitHub Enterprise Server',
266-
token: '123-456' as Token,
266+
token: 'encrypted' as Token,
267267
user: mockGitifyUser,
268268
version: '3.0.0',
269269
},

0 commit comments

Comments
 (0)