Comments (17)
Actually we completely missed the Electron app scenario, but it should be an easy fix.
from appwrite.
Correct code should be:
// Init SDK
let client = new sdk.Client();
let auth = new sdk.Auth(client);
But when I set Endpoint to http://localhost
or http://localhost/v1
i get 404 or 403
{ StatusCodeError: 403 - {"message":"Access from this client host is forbidden. URL host must be one of: https://appwrite.io, https://appwrite.test, http://appwrite.test, https://localhost, http://localhost, https://appwrite.io, https://appwrite.test, http://appwrite.test, https://localhost, http://localhost","code":403,"file":"/usr/share/nginx/html/app/app.php","line":89,"trace":[{"function":"{closure}","args":[]},{"file":"/usr/share/nginx/html/vendor/utopia-php/framework/src/App.php","line":387,"function":"call_user_func_array","args":[{},[]]},{"file":"/usr/share/nginx/html/app/app.php","line":767,"function":"run","class":"Utopia\\App","type":"->","args":[{},{}]},{"file":"/usr/share/nginx/html/public/index.php","line":27,"args":["/usr/share/nginx/html/app/app.php"],"function":"include"}],"version":"0.2.0"}
from appwrite.
I wanted use appwrite with ElectronApp so I don't want set any URL in Platforms :/
from appwrite.
Yeh sorry about it, will make sure to fix it by the end of the day. Thanks for paying attention @GrzegorzZajac000 !
from appwrite.
About the 403 I'll send you a fix later today.
from appwrite.
Thanks @eldadfux ;)
from appwrite.
@eldadfux any new info about support for Electron App?
from appwrite.
@GrzegorzZajac000 This should allow you to workaround the issue until we release next version with a fix:
let client = new sdk.Client();
client.addHeader('origin', 'http://localhost');
from appwrite.
Unfortunately this solution doesn't work :(
Response is the same
from appwrite.
client.addHeader('Origin', 'http://localhost');
maybe with a capital letter? 🧐
from appwrite.
Nope :/ It doesn't work too
from appwrite.
Sorrry, are you using the JS SDK?
from appwrite.
NodeJS SDK
from appwrite.
Please paste the complete code example so I can run it from my machine.
from appwrite.
const sdk = require('node-appwrite');
// Init SDK
let client = new sdk.Client();
client.addHeader('Origin', 'http://localhost');
let auth = new sdk.Auth(client);
client
.setProject('PROJECT_ID')
.setEndpoint('http://localhost/v1')
.setKey('');
let promise = auth.register('[email protected]', 'password', 'https://example.com');
promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
from appwrite.
@GrzegorzZajac000 This example works for me:
const sdk = require('node-appwrite');
// Init SDK
let client = new sdk.Client();
//client.setSelfSigned(true);
client.addHeader('Origin', 'http://localhost');
let auth = new sdk.Auth(client);
client
.setProject('project_id')
.setEndpoint('https://localhost/v1')
//.setKey('')
;
let promise = auth.register(
'[email protected]',
'password',
'https://localhost/confirm',
'https://localhost/success',
'https://localhost/failure',
'my name'
);
promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});
from appwrite.
Hmmm, it works! I had to do something wrong :) Thank you 👍
from appwrite.
Related Issues (20)
- 🐛 Bug Report: A user can update permissions to grant additional permissions
- 🐛 Bug Report: Account SDK Client Request in Render HOT 2
- 🚀 Feature: Authjs with Appwrite adapter HOT 5
- Appwrite Internal Error HOT 3
- Add these Headers for this error : {"message":"Server Error","code":500,"type":"general_unknown","version":"0.12.73"}
- 🐛 Bug Report: CLI Project List command - distorted table and irrelevant data output. HOT 5
- 🐛 Bug Report: Web SDK fails to disconnect when the unsubscribe function is returned HOT 3
- 🐛 Bug Report: AppwriteException [Error]: Server Error when accessing database from appwrite function by schedule HOT 4
- 🐛 Bug Report: Query select returns not explicitly requested fields HOT 5
- 🐛 Bug Report: Duplicate Executions of Cloud Functions HOT 3
- 🐛 Bug Report: Display Name settings aren't saving HOT 2
- 🐛 Bug Report: Proxy pass Apache HOT 2
- 🐛 Bug Report: account.createRecovery returns 500 general_unknown if the user doesn't have a name HOT 3
- 🚀 Feature: Introduce Custom JWT Expiration Date Support HOT 2
- 🐛 Bug Report: Unable to add most recently created collection (collection #26) as a relationship attribute HOT 2
- 🐛 Bug Report: Default Login email template missing {{user}} variable, always reads broken "Hey,," HOT 14
- 🐛 Bug Report: Phone Auth Verification HOT 2
- 🐛 Bug Report: Incorrect Error Handling When Passing Int as documentId parameter HOT 9
- 🐛 Bug Report: 500 error HOT 2
- 🐛 Bug Report: HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from appwrite.