Include Auth::RequireSignedInUser failed #326
-
|
The error message: [Error: undefined constant Auth::RequireSignedInUser] is displayed. The code section "class ArticleCreateHandler < Marten::Handlers::RecordCreate source: https://github.com/UweWagner403/openEHS/blob/main/src/handlers/article_create_handler.cr |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Hey! 👋 Can you make sure to require the require "../apps/auth/handlers/concerns/require_signed_in_user"
class ArticleCreateHandler < Marten::Handlers::RecordCreate
include Auth::RequireSignedInUser
# ...
endAlternatively, in your # Third party requirements.
require "marten"
require "marten_auth"
require "sqlite3"
# Configuration requirements.
require "../config/settings/base"
require "../config/settings/**"
#require "../config/initializers/**"
require "../config/routes"
# Project requirements.
require "./apps/auth/app" # should appear first
require "./emails/**"
require "./handlers/**"
require "./models/**"
require "./schemas/**" |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for your time, the changed require order solved the problem. |
Beta Was this translation helpful? Give feedback.
Hey! 👋
Can you make sure to require the
Auth::RequireSignedInUsermodule?Alternatively, in your
src/project.crfile you can make sure to require theauthapp before other src-level requirements: