Generated files
This page provides a reference of the files that are generated for the auth application when running the new management command with the --with-auth option or when using the auth generator.
Application
The auth application is generated under the src or src/apps folder. In addition to the abstractions mentioned below, this folder defines the following top-level files:
app.cr- The entrypoint of theauthapplication, where all the other abstractions are requiredcli.cr- The CLI entrypoint of theauthapplication, where CLI-related abstractions (like migrations) are requiredroutes.cr- Theauthapplication routes map
Emails
password_reset_email.cr- Defines the email that is sent as part of the user password reset flow
Handlers
handlers/concerns/require_anonymous_user.cr- A concern that ensures that a handler can only be accessed by anonymous usershandlers/concerns/require_signed_in_user.cr- A concern that ensures that a handler can only be accessed by signed-in usershandlers/password_reset_confirm_handler.cr- A handler that handles resetting a user's password as part of the password reset flowhandlers/password_reset_initiate_handler.cr- A handler that initiates the password reset flow for a given userhandlers/password_update_handler.cr- A handler that allows to update the user's passwordhandlers/profile_handler.cr- A handler that displays the currently signed-in user profilehandlers/sign_in_handler.cr- A handler that allows users to sign inhandlers/sign_out_handler.cr- A handler that allows users to sign outhandlers/sign_up_handler.cr- A handler that allows users to sign up
Migrations
migrations/0001_create_auth_user_table.cr- Allows to create the table of theAuth::Usermodel
Models
models/user.cr- Defines the mainAuth::Usermodel
Schemas
schemas/password_reset_confirm_schema.cr- A schema that allows a user to reset their passwordschemas/password_reset_initiate_schema.cr- A schema that allows a user to initiate the password reset flowschemas/password_update_schema.cr- A schema that allows a user to update their passwordschemas/sign_in_schema.cr- A schema used to sign in usersschemas/sign_up_schema.cr- A schema used to sign up users
Templates
templates/auth/emails/password_reset.html- The template of the password reset emailtemplates/auth/password_reset_confirm.html- The template used to let users reset their passwordstemplates/auth/password_reset_initiate.html- The template used to let users initiate the password reset flowtemplates/auth/password_update.html- The template used to let users update their passwordtemplates/auth/profile.html- The template of the user profiletemplates/auth/sign_in.html- The sign in page templatetemplates/auth/sign_up.html- The sign up page template
Specs
All the previously mentioned abstractions have associated specs that are defined under the spec/apps/auth folder.