mr-m1m3 / explo Goto Github PK
View Code? Open in Web Editor NEWExplore quiestions that you were never asked
Explore quiestions that you were never asked
If users enter their credentials correctly, sveltekit throws an error saying:
Error: Data returned from action inside /(public)/login is not serializable: Cannot stringify arbitrary non-POJOs
Imagine, I tried to access an authorized user while I'm unauthorized. As an expected behavior, I'll be redirected to /login
. Now, if /login
redirects me to /
I would be be unhappy. To maximize the user experience, we should redirect he user back to where they came from.
Currently any error that is thrown by pb sdk is treated as unauthorized
. But, pb can cause other errors like ECONNREFUSED
or other validation errors.
read()
utility function currently reads the whole request body and returns the data wrapped inside Result<T, E>
. However, it might not need to do this. We already know what property values we want, so reading the whole request body is not important. Rather, we can create an utility function that takes and returns the property values we want.
For example, in the login page, we only want email
and password
property of the request to be read. In current implementation, read function will read the whole body. Like, if someone sends a request packed like this:
{
email: "",
password: "",
foo: "",
bar: ""
}
read()
utility will actually read the additional properties foo
and bar
too.
However, it would be nice, if we could implement it in a way that only takes the request body and an array of properties we want to read. Then, the utility can loop through the array instead of the request body and do the rest. As a result, additional properties won't be read. Which IMO would be better.
An authorized user should not see login/signup page
Pocketbase sdk returns fetched data as RecordAuthResponse<T = Record>. Where we should get our data as T
. However, there are some extra keys that pocketbase adds such as id
, collectionName
, updated
, created
etc. If they are not included in T
, ide won't suggest properties that pb added. To solve this, all data that we fetch from pocketbase should extend :
interface PbSpecificKeys{
id: string;
collectionName:string;
updated:string;
....
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.