Skip to content

Commit adb136f

Browse files
committed
force shown providers must be registered
1 parent 6d5a17d commit adb136f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,6 @@ export const AiohaPage = () => {
7676
|`onClose`||Function to be called to close the modal.||
7777
|`imageServer`||Image server URL for user avatar.|https://images.hive.blog|
7878
|`explorerUrl`||Hive block explorer URL.|https://hivehub.dev|
79+
|`forceShowProviders`||List of `Providers` to force show as login option, which must be registered already. Clicking on unavailable providers displayed will open the URL of the provider landing page.|*[]*|
7980

8081
ℹ️ Note: `hiveauth.cbWait` in `loginOptions` will be overriden as `AiohaModal` will handle the presentation of HiveAuth QR codes.

lib/components/login/ProviderSelection.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const Badge = ({ children }: { children?: ReactNode }) => {
1616
const ProviderBtn = ({ provider, forceShow, onClick }: { provider: Providers; forceShow: boolean; onClick: ProviderCb }) => {
1717
const { aioha } = useAioha()
1818
const { name, icon, iconDark, loginBadge } = ProviderInfo[provider]
19-
return aioha.isProviderEnabled(provider) || forceShow ? (
19+
return aioha.isProviderEnabled(provider) || (forceShow && aioha.isProviderRegistered(provider)) ? (
2020
<li>
2121
<a
2222
className="flex items-center p-3 text-base font-bold text-gray-900 rounded-lg bg-gray-50 hover:bg-gray-100 group hover:shadow hover:cursor-pointer dark:bg-gray-600 dark:hover:bg-gray-500 dark:text-white"

0 commit comments

Comments
 (0)