Deta Auth, by Sourfruit
Verify authentication state in a Deta Space app, among other things.
/api/secure
Currently loading...
useAuthState (Deta Auth) returns a loading state, which can be used in tandem with a loader to prevent content being viewed before you know if a user's logged in or not.
Unauthenticated
useAuthState (Deta Auth) returns an auth object, including auth.session. Ultimately, this is the entire point of the hook.
No error
useAuthState (Deta Auth) returns an error object, notifying you if there was an error encountered when requesting state.
useAuthState (Deta Auth) returns an auth object, including auth.url which allows you to quickly get the custom Space subdomain a user was assigned.