{"id":17774984,"url":"https://github.com/mitinpavel/current_user","last_synced_at":"2025-10-20T03:39:44.569Z","repository":{"id":62556575,"uuid":"1863451","full_name":"MitinPavel/current_user","owner":"MitinPavel","description":"Dev phase auth for Rails","archived":false,"fork":false,"pushed_at":"2013-07-19T13:22:15.000Z","size":239,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-11T11:35:09.660Z","etag":null,"topics":["authentication","rails","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MitinPavel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.rdoc","contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-06-08T03:41:42.000Z","updated_at":"2022-01-10T13:03:07.000Z","dependencies_parsed_at":"2022-11-03T06:15:28.876Z","dependency_job_id":null,"html_url":"https://github.com/MitinPavel/current_user","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MitinPavel%2Fcurrent_user","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MitinPavel%2Fcurrent_user/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MitinPavel%2Fcurrent_user/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MitinPavel%2Fcurrent_user/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MitinPavel","download_url":"https://codeload.github.com/MitinPavel/current_user/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234296417,"owners_count":18809999,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","rails","ruby"],"created_at":"2024-10-26T21:54:22.252Z","updated_at":"2025-09-26T07:31:49.828Z","avatar_url":"https://github.com/MitinPavel.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CurrentUser\n\n[![Build Status](https://secure.travis-ci.org/MitinPavel/current_user.png?branch=master)](http://travis-ci.org/MitinPavel/current_user)\n[![Code Climate](https://codeclimate.com/github/MitinPavel/current_user.png)](https://codeclimate.com/github/MitinPavel/current_user)\n\nDev phase auth for Rails.\n\n## What it is\n\n* A simple authentication gem for the development (pre-production) phase\n* Familiar rails conventions: #current_user, #signed_in?\n* A minimalistic signin page with a list of all available users (just click on a user and you will be logged in under the user)\n* An opportunity to replace it with one of the mature solution (assuming Devise)\n\n## What it is not\n\n* An authentication solution for the production phase of the application lifecycle\n* An authorization gem (although in the future it might get some authorization features to mimic Devise)\n\n## How it looks like\n\n[![Screenshot of the sign in page](https://lh3.googleusercontent.com/-fft8seAAZok/US50C-4PxPI/AAAAAAAAAUE/73jy9XkwQt0/s743/current_user_screenshot.png)]\n\n## Getting started\n\nCurrentUser works with Rails 3.2 and 4.0 using Ruby 1.9.3 or Ruby 2.0.\n\nAdd to your Gemfile:\n\n```ruby\ngem \"current_user\"\n```\n\nInstall it using bundler:\n\n```console\nbundle install\n```\n\n__Note__: CurrentUser assumes your application already has a few users.\nSo if the assumption is false, create User active record class AND/OR add several users to the database.\nIt also assumes User has \"email\" attribute/method. If it is not the case, add \"email\" or change configuration\nin `config/initializers/current_user.rb`.\n\nRun the generator:\n\n```console\nrails generate current_user:install\n```\n\nThe generator:\n* creates a file with a unique authentication key for your application\n* creates an initializer\n* inject routing to your application\n* show README\n\nSpecify root in `config/routes.rb`:\n\n```ruby\nroot :to =\u003e 'dashboards#show'\n```\n\nAdd before filter to `app/controllers/application_controller.rb`:\n\n ```ruby\nbefore_filter :authenticate_user!\n ```\n\nTry to visit one of protected pages of your application (for example root). You will see \"Unauthorized\" error page.\n\nRun a rake task what shows a path to your sign in page:\n```console\nrake current_user:sign_in_path\n```\n\nVisit your sign in page. You will see a list of users of your application. Click on a user and the link\nwill take you to the root page of the application.\n\nCongratulations. Your application has a simple authentication solution. _Send a link to the sign in page\nto your customer and she/he will love to test your app manually :)_\n\n## Helpers\n\nCurrentUser creates some helpers to use inside your controllers and views.\n\nTo verify if a user is signed in, use the following helper:\n\n```ruby\nsigned_in?\n```\n\nFor the current signed-in user, this helper is available:\n\n```ruby\ncurrent_user\n```\n\n## Logo\n\n[![CurrentUser on RubyGems](http://i.minus.com/irnTZ9R2xPyzi.png)](http://rubygems.org/gems/current_user)\n\n## License\n\nIt uses MIT license. See MIT-LICENSE file in the root directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitinpavel%2Fcurrent_user","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitinpavel%2Fcurrent_user","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitinpavel%2Fcurrent_user/lists"}