-
Notifications
You must be signed in to change notification settings - Fork 33
feat: multi user authentication #371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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.
|
Should we use JWT for auth handling, or keep track of sessions? |
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.
|
@je-sendra We will want to track sessions on the server most likely |
| #[derive(Deserialize)] | ||
| pub struct LoginRequest { | ||
| pub username: String, | ||
| pub password: String, | ||
| } | ||
|
|
||
| #[derive(Serialize)] | ||
| pub struct LoginResponse { | ||
| pub token: String, | ||
| } |
There was a problem hiding this comment.
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.
JMBeresford
left a comment
There was a problem hiding this 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.
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.