{"id":15583204,"url":"https://github.com/ylecuyer/devise_session_limit","last_synced_at":"2025-12-25T09:04:41.279Z","repository":{"id":4119584,"uuid":"5230357","full_name":"ylecuyer/devise_session_limit","owner":"ylecuyer","description":"Devise mixin to limit the number of simultaneous sessions with the same credentials","archived":false,"fork":false,"pushed_at":"2019-12-03T16:24:03.000Z","size":6,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-03-05T17:57:53.843Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ylecuyer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-07-30T09:16:14.000Z","updated_at":"2021-05-28T08:39:57.000Z","dependencies_parsed_at":"2022-07-21T12:18:00.537Z","dependency_job_id":null,"html_url":"https://github.com/ylecuyer/devise_session_limit","commit_stats":null,"previous_names":["dimelo/devise_session_limit"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ylecuyer%2Fdevise_session_limit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ylecuyer%2Fdevise_session_limit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ylecuyer%2Fdevise_session_limit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ylecuyer%2Fdevise_session_limit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ylecuyer","download_url":"https://codeload.github.com/ylecuyer/devise_session_limit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243232284,"owners_count":20258078,"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":[],"created_at":"2024-10-02T20:05:36.777Z","updated_at":"2025-12-25T09:04:36.256Z","avatar_url":"https://github.com/ylecuyer.png","language":"Ruby","readme":"# DeviseSessionLimit\n\nDevise plugin preventing a user from having multiple open sessions\n\nUsing code from [https://github.com/phatworx/devise_security_extension](devise_security_extension)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'devise_session_limit'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install devise_session_limit\n\n## Usage\n\nIn your `User` model:\n\n    class User\n\n      # Additional field\n      field :unique_session_id, :type =\u003e String\n\n      # Additional devise module\n      devise ..., :session_limit\n\n    end\n\nAdd some translation key for the error message:\n\n    en:\n      devise:\n        failure:\n          session_limited: \"You are already signed in from another place\"\n\n## Customize\n\nYou can customize the behaviour from the `User` model by overriding or chaining this two methods:\n\n      # Called at each sign in\n      def update_unique_session_id!(unique_session_id)\n        self.unique_session_id = unique_session_id\n        save(:validate =\u003e false)\n      end\n\n      # Called at each request, you can override to implement your own behaviour\n      def check_unique_session_id session_id\n        self.unique_session_id == session_id\n      end","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fylecuyer%2Fdevise_session_limit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fylecuyer%2Fdevise_session_limit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fylecuyer%2Fdevise_session_limit/lists"}