You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					11 lines
				
				433 B
			
		
		
			
		
	
	
					11 lines
				
				433 B
			| 
								 
											2 years ago
										 
									 | 
							
								<?php
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								use RobThree\Auth\TwoFactorAuth;
							 | 
						||
| 
								 | 
							
								require_once __DIR__ . "/../vendor/autoload.php";
							 | 
						||
| 
								 | 
							
								$tfa = new TwoFactorAuth("Hestia Control Panel");
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								$secret = $tfa->createSecret(160); // Though the default is an 80 bits secret (for backwards compatibility reasons) we recommend creating 160+ bits secrets (see RFC 4226 - Algorithm Requirements)
							 | 
						||
| 
								 | 
							
								$qrcode = $tfa->getQRCodeImageAsDataUri(gethostname(), $secret);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								echo $secret . "-" . $qrcode;
							 |