20 lines
		
	
	
		
			389 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			389 B
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| # Copyright (C) 2024 Manuel Bustillo
 | |
| 
 | |
| class CaptchaController < ApplicationController
 | |
|   skip_before_action :authenticate_user!
 | |
|   skip_before_action :set_tenant
 | |
|   def create
 | |
|     id = LibreCaptcha.new.get_id
 | |
|     render json: {
 | |
|       id:,
 | |
|       media_url: media_captcha_index_url(id:)
 | |
|     }, status: :created
 | |
|   end
 | |
| 
 | |
|   private
 | |
| 
 | |
|   def set_tenant
 | |
|     ActsAsTenant.current_tenant = nil
 | |
|   end
 | |
| end
 |