hasura / js-sdk Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Throw error before setUsername
is called when user is already already logged.
Similar edge cases to prevent signup/login being called when a user is already logged in.
@jaisontj
Maybe different architecture entirely when skanda?
@coco98
The example given for quickstart of the readme , the method used is hasura.login("password", onSuccess, onError) whic is not a defined method , it should be hasura.auth.login("password", onSuccess, onError) in the docs
@coco98
the url
https://github.com/hasura/js-sdk/releases/download/v0.1.1/hasura.min.js
leading to url
https://github-production-release-asset-2e65be.s3.amazonaws.com/95100399/a9615f7c-5adf-11e7-9908-14d4c4bbc131?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20170725%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170725T122804Z&X-Amz-Expires=300&X-Amz-Signature=da8892b7b7e7a260a82a2d38811bc5ab644deb2e197c6d6bf9581022903fa470&X-Amz-SignedHeaders=host&actor_id=25777018&response-content-disposition=attachment%3B%20filename%3Dhasura.min.js&response-content-type=application%2Foctet-stream
is getting caught as a deceptive site (phishing) by google chrome as well as firefox.
The filestore usage doesn't work with the usage given.
The variable declared below doesn't work for me,
var file = input.files[0];
I solved this by declaring the variable as below,
var file = input;
I need clarification on how this works.
Please update the docs so that they're easy to understand and implement for beginners.
The success and error callbacks of the Hasura Auth class don't return the corresponding success and error messages with status code. The messages are just printed on the console. The Data class on the other hand does return the corresponding messages but no status code.
Should feature:
@coco98
In js-sdk/src/Auth.js , from Line 15 to 47 exists the signup function , on line 15 which is the function declaration there is a parameter "options" which has no occurrence throughout the function definition , meaning it has no use and being passed just like that , since there is no example also for the signup method , it is quite confusing for first timers , following is a supporting use case.
for the following code,
function mySuccessHandler () {
alert("Signup success")
if(hasura.user.token){
window.location="./selectable.html";
}
}
function myErrorHandler () {
alert("Signup Failed, Please try again")
}
hasura.auth.signup(password,
mySuccessHandler,
myErrorHandler
);
despite signup being sucessfull, "myErrorHandler" was called ,which was absurd, onerror being called instead of onsuccess callback , later identified as , "mysuccesshandler" was getting mapped to "options" parameter and "myErrorHandler" being mapped to "onsuccess" callback instead of "onerror" callback , this was confirmed as following code worked fine,
function mySuccessHandler () {
alert("Signup success")
if(hasura.user.token){
window.location="./selectable.html";
}
}
function myErrorHandler () {
alert("Signup Failed, Please try again")
}
hasura.auth.signup(password,"option",
mySuccessHandler,
myErrorHandler
);
when i passed an arbitrary argument , just a random string in place of "options" parameter , everything worked well.
Custom method to setUserInfo (as an alternative to login)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.