kubesail / pibox-host

8 stars 0 forks source link

Miscellaneous issues / questions #18

Closed AndrewDennistoun closed 1 year ago

AndrewDennistoun commented 1 year ago

I know basically zero javascript so I might be misinterpreting a lot of this but I figured I'd create an issue for clarification anyway @pastudan:

  1. The middlewareAuth import was removed from users/index.js but this is still there, so I get an error when trying to list users: https://github.com/kubesail/pibox-host/blob/049a2bee02d8174040df067b5c195fef5f893b5f/src/pages/api/users/index.js#L5-L7

  2. After fixing the previous error in a local branch, I get this error when trying to list users to select for login, which seems like it shouldn't be there: https://github.com/kubesail/pibox-host/blob/049a2bee02d8174040df067b5c195fef5f893b5f/src/pages/api/users/index.js#L9-L11

  3. I got different error when trying to implement logout:

  4. This one isn't an error I was just curious, did we decide to change the "PiBox Username" field to "Full Name" instead for setup? https://github.com/kubesail/pibox-host/blob/049a2bee02d8174040df067b5c195fef5f893b5f/src/pages/api/setup.js#L23 I know we were trying to emphasize that it's completely local but I remembered us discussing the change from "Username" to "PiBox Username" achieved that. Totally fine either way but right now the username field validation assumes we need a valid linux username (i.e. no spaces) so I'll need to change it (which will be easy).

pastudan commented 1 year ago

I fixed those problems, thanks for the detailed issue!

I did change it to fullName, so you can send in any string and I'll convert it into a linux safe username. For example "Dan Pastusek" would become danpastusek. I think that is simpler for the end user to see a list of logins and select the name that's theirs. I definitely need to give you a list of fullNames back with the GET /users route. We can discuss how best to do that tomorrow

pastudan commented 1 year ago

Since that route already responds with an array of objects, I'll probably just add fullName onto that object