From 0bb2aadb8a03fab3a02ecb71440f5b4b895ba80c Mon Sep 17 00:00:00 2001 From: Federico Brigante Date: Fri, 31 May 2024 17:11:51 +0800 Subject: [PATCH] Add `isLoggedIn` (#191) --- index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.ts b/index.ts index 373b32f..ae593f6 100644 --- a/index.ts +++ b/index.ts @@ -19,6 +19,8 @@ export const is500 = (): boolean => document.title === 'Server Error ยท GitHub' export const isPasswordConfirmation = (): boolean => document.title === 'Confirm password' || document.title === 'Confirm access'; +export const isLoggedIn = (): boolean => exists('body.logged-in'); + export const isBlame = (url: URL | HTMLAnchorElement | Location = location): boolean => Boolean(getRepo(url)?.path.startsWith('blame/')); addTests('isBlame', [ 'https://github.com/sindresorhus/refined-github/blame/master/package.json',