Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📚 Documentation: #19

Open
2 tasks done
Aronastu opened this issue Mar 27, 2023 · 3 comments
Open
2 tasks done

📚 Documentation: #19

Aronastu opened this issue Mar 27, 2023 · 3 comments
Assignees

Comments

@Aronastu
Copy link

💭 Description

this Sdk not include, Account client side functionality.
like [Create Account]
[ Create Email Session]
and other.

How can I do it, client side functionality in PHP SDK

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@joeyouss
Copy link

Hi,
Can you please elaborate a bit on this issue?

@shreyatak
Copy link

I cannot find functions to create a session in Account.php. I only found functions like createRecovery, createVerification, and createPhoneVerification in Accounts. I did find it in flutter with names create, createEmailSession, etc.

How can we create sessions using PHP SDK? Am I missing something?

@dweipert-3138720606
Copy link

dweipert-3138720606 commented Apr 13, 2023

I tried to work around the missing createEmailSession function by just calling it manually

$promise = $client->call(Client::METHOD_POST, '/account/sessions/email', [
  'content-type' => 'application/json',
], [
  'email' => $request->get('email'),
  'password' => $request->get('password'),
]);

I get a Session object in return as stated by the documentation, but when trying to get the current session with

$account->get();

I get the error

Fatal error: Uncaught Appwrite\AppwriteException: User (role: guests) missing scope (account)

and I don't know how to go from there.

I guess since the Server documentation doesn't list a createEmailSession function, that means it's not possible to authenticate a user from the server-side?

//EDIT:

Re-read the docs and found this https://appwrite.io/docs/authentication-server
So we have to authenticate the user from the client-side first with JWT auth, send the JWT to the server and work from there. I personally would love a javascript-less, jwt-less, server-side solution in the future. Is that on the roadmap anywhere currently?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants