Skip to content

Commit 0bb2aad

Browse files
authored
Add isLoggedIn (#191)
1 parent 62b20df commit 0bb2aad

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ export const is500 = (): boolean => document.title === 'Server Error · GitHub'
1919

2020
export const isPasswordConfirmation = (): boolean => document.title === 'Confirm password' || document.title === 'Confirm access';
2121

22+
export const isLoggedIn = (): boolean => exists('body.logged-in');
23+
2224
export const isBlame = (url: URL | HTMLAnchorElement | Location = location): boolean => Boolean(getRepo(url)?.path.startsWith('blame/'));
2325
addTests('isBlame', [
2426
'https://github.com/sindresorhus/refined-github/blame/master/package.json',

0 commit comments

Comments
 (0)