Skip to content

Document how to add authentication - #155

Open
koppen wants to merge 1 commit into
mainfrom
docs/authentication
Open

Document how to add authentication#155
koppen wants to merge 1 commit into
mainfrom
docs/authentication

Conversation

@koppen

@koppen koppen commented Sep 5, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI lite review requested due to automatic review settings September 5, 2026 20:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new documentation contains inaccurate statements (e.g., about Uchi::Current and “all controllers” coverage) that could mislead users implementing authentication.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds documentation explaining how to integrate application-level authentication with Uchi, and links the new page into the docs navigation.

Changes:

  • Introduces a new docs/authentication.md guide with an example based on Rails’ authentication generator patterns.
  • Adds an “Authentication” entry to docs/_sidebar.yml so the page appears in the documentation sidebar.
File summaries
File Description
docs/authentication.md New authentication guide for restricting access to Uchi controllers and describing current-user access.
docs/_sidebar.yml Adds the new Authentication page to the sidebar navigation.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/authentication.md
@@ -0,0 +1,42 @@
# Authentication

As with everything Uchi tries to assume as little as possible about your application, therefore authentication is also up to you. This means you continue to use whatever authentication mechanism you've already implemented, be it HTTP Basic Authentication, Devise, Rails' authentication generator, or something entirely different.
Comment thread docs/authentication.md
Comment on lines +11 to +12
To restrict access to all Uchi-controllers, add an `Uchi::ApplicationController` at `app/controllers/uchi/application_controller.rb`:

Comment thread docs/authentication.md
Comment on lines +40 to +42
Uchi exposes a [Uchi::Current](https://api.rubyonrails.org/classes/ActiveSupport/CurrentAttributes.html) class which includes the currently logged in user at `Uchi::Current.user`.

By default Uchi gets the user using the global `current_user` method, so it should work with Devise and most Rails authentication systems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants