403Webshell
Server IP : 104.21.14.103  /  Your IP : 3.129.45.150
Web Server : LiteSpeed
System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : giankuin ( 1871)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/giankuin/dietcontrungnhanh.com/wp-content/plugins/ithemes-security-pro/pro/webauthn/entries/profile/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/giankuin/dietcontrungnhanh.com/wp-content/plugins/ithemes-security-pro/pro/webauthn/entries/profile/app.js
/**
 * WordPress dependencies
 */
import { __ } from '@wordpress/i18n';
import { createInterpolateElement, useState, Fragment } from '@wordpress/element';
import { useSelect, useDispatch } from '@wordpress/data';

/**
 * SolidWP dependencies
 */
import {
	Button,
	TextSize,
	TextWeight,
	TextVariant,
	ShadowPortal,
} from '@ithemes/ui';

/**
 * Internal dependencies
 */
import { store, App as ManageCredentials, LearnMore } from '@ithemes/security.webauthn.manage';
import {
	StyledModal,
	StyledHeading,
	StyledTextContainer,
	StyledDevicesHeader,
	StyledCredentialList,
	StyledCredential,
} from './styles.js';
import './styles.scss';

const styleSheetIds = [ 'wp-components-css' ];

export default function App( { useShadow } ) {
	const [ isOpen, setIsOpen ] = useState( false );
	const [ isRequested, setIsRequested ] = useState( false );
	const { credentials } = useSelect( ( select ) => ( {
		credentials: select( store ).getCredentials(),
	} ), [ ] );

	const { navigateTo } = useDispatch( store );

	const onOpen = () => {
		if ( credentials.length > 0 ) {
			navigateTo( 'manage-credentials' );
			setIsRequested( true );
		} else {
			navigateTo( 'add-credential' );
			setIsRequested( false );
		}
		setIsOpen( true );
	};

	const Container = useShadow ? ShadowPortal : Fragment;
	const containerProps = useShadow ? { styleSheetIds, inherit: true } : {};

	return (
		<>
			<Container { ...containerProps }>
				<StyledTextContainer>
					<StyledHeading
						level={ 3 }
						size={ TextSize.LARGE }
						variant={ TextVariant.DARK }
						weight={ TextWeight.HEAVY }
						text={ __( 'Passkeys', 'it-l10n-ithemes-security-pro' ) }
					/>
					<p>
						{ createInterpolateElement(
							__( 'Passkeys <b>improve security</b> and <b>speed up the login process</b> by using authentication built into your device instead of passwords. This can mean biometrics like Face ID, Touch ID, or Windows Hello. If your device doesn’t have those capabilities, don’t worry, you can still use passkeys.', 'it-l10n-ithemes-security-pro' ),
							{
								b: <strong />,
							}
						) }
						{ __( ' Advanced users can also use external security keys like a YubiKey or Titan Key.', 'it-l10n-ithemes-security-pro' ) }
					</p>
					<p>
						{ __( 'When authenticating with a passkey, your personal information never leaves your device. Hackers can’t leak passkeys or trick you into sharing them.', 'it-l10n-ithemes-security-pro' ) }
						{ ' ' }
						<LearnMore textSize={ TextSize.NORMAL } />
					</p>

					{ credentials.length === 0 && (
						<Button
							variant="secondary"
							aria-expanded={ isOpen }
							onClick={ onOpen }
							text={ __( 'Setup Passkeys', 'it-l10n-ithemes-security-pro' ) }
						/>
					) }

					{ credentials.length > 0 && (
						<>
							<StyledDevicesHeader>
								<h4>{ __( 'Registered Passkeys', 'it-l10n-ithemes-security-pro' ) }</h4>
								<Button
									variant="secondary"
									aria-expanded={ isOpen }
									onClick={ onOpen }
									text={ __( 'Manage Passkeys', 'it-l10n-ithemes-security-pro' ) }
								/>
							</StyledDevicesHeader>
							<StyledCredentialList>
								{ credentials.map( ( credential ) => (
									<StyledCredential key={ credential.id } credential={ credential } as="li" />
								) ) }
							</StyledCredentialList>
						</>
					) }
				</StyledTextContainer>
			</Container>
			{ isOpen && (
				<StyledModal
					className="manage-passkeys-modal"
					onRequestClose={ () => setIsOpen( false ) }
					__experimentalHideHeader
					contentLabel={ __( 'Manage Passkeys', 'it-l10n-ithemes-security-pro' ) }
				>
					{ useShadow ? (
						<ShadowPortal styleSheetIds={ styleSheetIds }>
							<ManageCredentials onExit={ () => setIsOpen( false ) } isRequested={ isRequested } />
						</ShadowPortal>
					) : <ManageCredentials onExit={ () => setIsOpen( false ) } isRequested={ isRequested } /> }
				</StyledModal>
			) }
		</>
	);
}

Youez - 2016 - github.com/yon3zu
LinuXploit