All checks were successful
		
		
	
	Playwright Tests / test (pull_request) Has been skipped
				
			Check usage of free licenses / build-static-assets (pull_request) Successful in 1m12s
				
			Add copyright notice / copyright_notice (pull_request) Successful in 1m32s
				
			Build Nginx-based docker image / build-static-assets (push) Successful in 6m2s
				
			
		
			
				
	
	
		
			19 lines
		
	
	
		
			562 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			562 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| /* Copyright (C) 2024-2025 LibreWeddingPlanner contributors*/
 | |
| 
 | |
| import { data } from "autoprefixer";
 | |
| import { getCsrfToken } from "../lib/utils";
 | |
| 
 | |
| export function getCaptchaChallenge({onRetrieve}: {onRetrieve: (id: string, url: string) => void}){
 | |
|   return fetch('/api/captcha', {
 | |
|     method: 'POST',
 | |
|     headers: {
 | |
|       'Accept': 'application/json',
 | |
|       'X-CSRF-TOKEN': getCsrfToken(),
 | |
|     }
 | |
|   })
 | |
|     .then((response) => response.json())
 | |
|     .then((data: any) => {
 | |
|       onRetrieve(data.id, data.media_url)
 | |
|     })
 | |
|     .catch((error) => console.error(error));
 | |
| } |