Comments (1)
This is an interesting one, because the router does correctly redirect users that don't have a session anymore - but it seems like the socket is still connected or at least the "request" is a LiveView request.
In InitAssigns
we assume the user is logged in; because "hey that's handled upstream". And I'm not convinced that we should handle redirection there either.
However, the actual line where things break is:
def on_mount(:project_scope, %{"project_id" => project_id}, _session, socket) do
%{current_user: current_user} = socket.assigns
project = Lightning.Projects.get_project(project_id)
projects = Lightning.Projects.get_projects_for_user(current_user) # <= HERE
#...
end
I think there is quite a bit we can improve with our routing/on_mount hooks here.
But for now I think it would be ok for us to redirect inside the :project_scope
hook, if there is no current_user
on the socket. I'd recommend pattern matching for it in a clause above the current one.
from lightning.
Related Issues (20)
- Adjust PromEx config to correctly export Oban data
- AI Assistant: Revead
- AI Assistant: Read, Review and Verify
- AI Assistant: Wrap content in chat interface.
- Allow openfn pull for projects without workflows.
- AI Assistant: Get feedback on AI responses HOT 2
- AI Assistant: Better UI on the session list
- AI Assistant: fix code font and style
- Scheduled deletion of users account does not work
- Local deployments should have self-signed certificates
- Fix the behaviour of the tooltip in the AI assistant when job is unsaved
- Allow users to specify if they want relative paths when pulling from OpenFn HOT 1
- Extend provisioner to support Kafka triggers
- OpenFn Ai Policy should not open "About AI Assistant"
- Inspector: Show the finalState when inspecting a run
- RunChannel errors not showing in Sentry
- Run Log stream cuts off on the run view for long logs
- Can't select a project/billing account in the switcher
- Can't inspect runs sometimes - It shows the lost connection icon and loads endlessly HOT 2
- Escape js expressions in `project.yaml`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lightning.