sdk-for-php
sdk-for-php copied to clipboard
📚 Documentation:
💭 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?
- [X] I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
- [X] I have read the Code of Conduct
Hi, Can you please elaborate a bit on this issue?
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?
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?