DanielFGray / DanielFGray/razzle-graphile

How can we manage session in the postgraphile app?

Open
#6 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Hi, I'm new to the Postgraphile and I've just started looking at this project to know about how the session is managed in this postgraphile app. I saw there are 2 tables being used for a session management in here, 1. `connect_pg_simple_sessions` 2. `sessions`. And I've seen that the `sessions` table gets updated in every valid graphql request made to the database which keeps track of user that made request and his/her last active time. Also it has been used to track user login while login request is made through `login` function in the database where on successful login a new record is inserted into this table. But the `connect_pg_simple_sessions` table has just been used or initialized at the time of middleware setup on the server. So I was wondering as if we're using the `sessions` table to track user logins and every graphql request made by user then what is the use of `connect_pg_simple_sessions` table within the app? How can we track user's session after their login like we normally do in normal express js app using any session library (i.e. like this conect pg simple for instance)? How can we send session inside a cookie to the user after user logs in in the postgraphile app?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the server middleware setup and the database login function mentioned in the issue, then compare how connect_pg_simple_sessions and sessions are used. Document the purpose of each table, how a logged-in user's session is tracked, and whether or how the session reaches the client cookie; the issue is done when this flow is clearly explained.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, postgresql, react, typescript
Domain
api, authentication, backend, database
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.