Skip to content

Conversation

@VewDev
Copy link
Contributor

@VewDev VewDev commented Aug 9, 2025

This is a draft PR for the upcoming multi user authentication feature. Development of the feature and technical discussion should be held in this issue.

VewDev added 2 commits August 9, 2025 21:35
Add an additional schema for auth related tables and add a "users" table to the new schema.
Add the auth schema to the "diesel.toml" file to allow it to autogenerate an "auth_schema.rs" file with tables from the "auth" schema.
@VewDev
Copy link
Contributor Author

VewDev commented Aug 10, 2025

Should we use JWT for auth handling, or keep track of sessions?

VewDev added 4 commits August 13, 2025 17:08
Add a new auth module to the services package with initial login logic.

Initial login logic does not include password validation or token generation, it just retrieves the user from the database and checks if it exists.
@JMBeresford
Copy link
Owner

@je-sendra We will want to track sessions on the server most likely

Comment on lines +18 to +27
#[derive(Deserialize)]
pub struct LoginRequest {
pub username: String,
pub password: String,
}

#[derive(Serialize)]
pub struct LoginResponse {
pub token: String,
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will want to eventually have these defined in the proto schema (the codegen package), ensuring that both the backend and frontend have identical definitions in Rust and TypeScript, respectively. While scaffolding this out in the backend it's likely fine here for now.

Copy link
Owner

@JMBeresford JMBeresford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great so far! I'm still thinking on whether or not the auth handlers should live in the HTTP server or the gRPC server. Feel free to chime in w/ your thoughts on the matter -- either way it should be relatively simple to migrate back and forth if needed in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants