Feature: User auth #15
No reviewers
Labels
No labels
backlog
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TWS/kalkutago#15
Loading…
Reference in a new issue
No description provided.
Delete branch "scott/kalkutago:feature/user-auth"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Resolves #2
3ce19da675
toe25301655b
396ed28079
toa390f79a75
WIP: Feature: User authto Feature: User auth@ -2,6 +2,8 @@ import { reactive } from "vue"
import { Track } from "./track"
Have you tried out vuex or the newer pinia yet?
It's been a while since I looked into it, but I think I remember reading something in their docs which suggested that they might be overkill for this situation.
@ -81,3 +103,2 @@
this.state = State.Fetched
},
}
async taskCompleted(track: Track, date: Date): Promise<Tick> {
For the API calls, is there a reason for them to be in
state
?From the Vue docs:
Yeah, but do these mutate state? I thought they were just making the request and returning the parsed body?
Ah, you raise a good point there. It was originally intended to, but then I changed it so that only the events update the state. Thanks for that.
@ -0,0 +13,4 @@
.if_not_exists()
.col(
ColumnDef::new(Users::Id)
.integer()
Does sea_orm support UUIDs?
It seems to support a UUID column type, but I don't see documentation for it, or for using it as a primary key. Is that important?
For this, probably not. However UUIDs can be nice for PKs on publicly facing resources as you cannot crawl them (ie
/user/3
suggests/user/4
exists). Slugs can be used to keep the url tidy.That makes sense. Though I think I might do
/user/{name}
if we add public profile pages (and/me
for the logged in user)@ -0,0 +11,4 @@
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.create_table(
Table::create()
Interesting DSL here...
These are generated by the sea-orm CLI 🤷
@ -21,0 +32,4 @@
track_id: i32,
user: &users::Model,
) -> Result<Json<tracks::Model>, Either<Status, api::ErrorResponder>> {
if let Some(Some(user)) = user
rename
user
->track
in assignment here@ -96,0 +94,4 @@
let receiver_count = tx.receiver_count();
if receiver_count > 0 {
trace!(receiver_count = receiver_count, update = as_serde!(self); "sending update");
let count = tx.send(self.clone())?;
use count here