Back

User (role: guests) missing scope (account)

  • 0
  • Self Hosted
  • Accounts
  • Tools
  • Web
D5
14 Jul, 2023, 08:49

Another approach with the SDK is create a JWT token with the SDK, sending it to your server and using the JWT there to Auth the user server sided

TL;DR
User is missing scope (account) in their application. They are uncertain about how to scale their application and what framework Appwrite supports best. They also have questions about how authentication works and the usage of server-side rendering (SSR). There is no solution provided in the support thread.
mustansirg
14 Jul, 2023, 20:27

That sounds very annoying for some reason, why doesn't it work more naturally? All projects I find pretty much use anonymous login which can be done on server side, or dont use the appwrite sdk on the server side conveniently. Do you have an example of how I can implement that?

Drake
14 Jul, 2023, 20:34

We have plans to improve how we handle SSR.

You've already found the best example for how to handle SSR.

mustansirg
14 Jul, 2023, 20:42

Well that only really works for anonymous login, what can I do to login with oauth?

D5
14 Jul, 2023, 20:42

It doesn't works naturally because you're rendering or in other words building the interface and data server sided instead of client sided

mustansirg
14 Jul, 2023, 20:43

How can I have qwik client send the cookie to qwik server? Hope you understand what I mean 🙂

D5
14 Jul, 2023, 20:43

Easiest way is performing that client sided, by rendering things client side

mustansirg
14 Jul, 2023, 20:44

But server can't make api calls then without access to user object right?

D5
14 Jul, 2023, 20:44

You don't call to the appwrite instance from server

D5
14 Jul, 2023, 20:44

Instead, from your client (users phone)

mustansirg
14 Jul, 2023, 20:44

But then what's the point of SSR?

D5
14 Jul, 2023, 20:44

You mean benefits?

mustansirg
14 Jul, 2023, 20:44

Yes

D5
14 Jul, 2023, 20:45

I could say, mainly SEO

D5
14 Jul, 2023, 20:45

And faster load for static data

D5
14 Jul, 2023, 20:46

But if you're building a website or app who has dynamic data, probably nothing of both things mentioned will matter

D5
14 Jul, 2023, 20:46

In the opposite case, as said, you will need to perform Auth client sided and then send the JWT to the server

mustansirg
14 Jul, 2023, 20:46

Fair enough, however. How does something like auth.js do this? They somehow work both client and server side natively for qwik. Maybe that can help appwrite optimize for ssr at some point

D5
14 Jul, 2023, 20:47

Sincerely, not sure how auth.js works, but probably the same way as if you perform authentication client sided and then you send the JWT to server side, but handling all of that automatically

mustansirg
14 Jul, 2023, 20:49

Thanks for that, not sure where to go from here since my application can't scale with limitations so might go for something custom. But I will definitely use Appwrite for something more smaller. Sorry for the trouble, lastly what framework does Appwrite support best? Where almost everything works out of the box?

D5
14 Jul, 2023, 20:50

Scaling doesn't has anything to do with what I have meant

D5
14 Jul, 2023, 20:51

You can scale with appwrite independently of the method used to render the website, as said, it has nothing to do with scaling

mustansirg
14 Jul, 2023, 20:52

Sorry, by scale I mean work with increase in complexity. Lesser the parts I build the better it is

D5
14 Jul, 2023, 21:48

I think the only more complex part will be Auth

Drake
15 Jul, 2023, 00:37

Like logging in with email and password? Same approach applies...replace the anonymous auth API call with the create email session API call

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more