Skip to content

Commit

Permalink
restrict graphiql to users that are signed in
Browse files Browse the repository at this point in the history
  • Loading branch information
fermion committed Jan 9, 2024
1 parent fed88be commit c8672a3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
end

# if Rails.env.development?
mount GraphiQL::Rails::Engine, at: "/graphiql", graphql_path: "/graphql"
mount GraphiQL::Rails::Engine, at: "/graphiql", graphql_path: "/graphql", constraints: lambda { |request|
# only allow authenticated users
Passwordless::Session.exists?(id: request.session[:"passwordless_session_id--user"])
}
# end

post "/graphql", to: "graphql#execute"
Expand Down

0 comments on commit c8672a3

Please sign in to comment.