You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Sidekiq in my Rails project. Since I already implemented authentication via Passwordless, I'd like to keep using Passwordless to protect Sidekiq Web UI, instead of adding another authentication solution, be it basic auth or something else.
# app/models/user.rbclassUser < ApplicationRecordvalidates:email,presence: true,uniqueness: {case_sensitive: false}passwordless_with:email# Treating all users as admins to make the example short. This part will likely look different in your app ✌️defadmin?trueendend
# config/routes.rbrequire'sidekiq/web'require'admin_constraint'Rails.application.routes.drawdopasswordless_for:usersmountSidekiq::Web=>'/sidekiq',constraints: AdminConstraint.new
...
end
Here's my question:
Is this use case interesting enough to add it to Passwordless' README?
It doesn't have to be Sidekiq-specific either: this can be used to protect routes from other engines as well.
The text was updated successfully, but these errors were encountered:
I am using Sidekiq in my Rails project. Since I already implemented authentication via Passwordless, I'd like to keep using Passwordless to protect Sidekiq Web UI, instead of adding another authentication solution, be it basic auth or something else.
Sidekiq docs does not (yet) feature an example for Passwordless, but their restful authentication or sorcery example is pretty close to a working solution. This is how I did it:
Here's my question:
Is this use case interesting enough to add it to Passwordless' README?
It doesn't have to be Sidekiq-specific either: this can be used to protect routes from other engines as well.
The text was updated successfully, but these errors were encountered: