Commit 24f5149a by Ivan

fix: fix auth

parent f506fe2b
......@@ -2,4 +2,10 @@ class ApplicationController < ActionController::Base
include Authentication
# Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.
allow_browser versions: :modern
inertia_share do
{
auth: authenticated?.user&.as_json(only: [ :id, :name, :email_address, :admin ])
}
end
end
class ImagesController < ApplicationController
# Allow unauthenticated access to index and show actions
allow_unauthenticated_access only: [:index, :show, :search]
# allow_unauthenticated_access only: [:index, :show, :search]
before_action :set_image, only: [:show, :edit, :update, :destroy, :approve, :reject]
before_action :authorize_admin, only: [:approve, :reject, :destroy]
......
......@@ -5,6 +5,8 @@ import * as Tabs from '@radix-ui/react-tabs'
import * as Form from '@radix-ui/react-form'
export default function Index({ images, filters, auth }) {
console.log('auth', auth)
const [searchParams, setSearchParams] = useState({
title_cont: filters.title_cont || '',
tags_name_cont: filters.tags_name_cont || '',
......
<h1>Tags#create</h1>
<p>Find me in app/views/tags/create.html.erb</p>
<h1>Tags#destroy</h1>
<p>Find me in app/views/tags/destroy.html.erb</p>
<h1>Tags#edit</h1>
<p>Find me in app/views/tags/edit.html.erb</p>
<h1>Tags#index</h1>
<p>Find me in app/views/tags/index.html.erb</p>
<h1>Tags#new</h1>
<p>Find me in app/views/tags/new.html.erb</p>
<h1>Tags#update</h1>
<p>Find me in app/views/tags/update.html.erb</p>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment