Coder Social home page Coder Social logo

js-sdk's People

Contributors

abhishekbhattacharya avatar ajasharma93 avatar coco98 avatar jaisontj avatar shahidhk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

js-sdk's Issues

Correction in Quickstart Documentation

@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
screenshot from 2017-07-24 11-11-00
screenshot from 2017-07-24 11-17-28

SRC url being caught as Deceptive site by chrome and firefox

Filestore usage

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.

Docs update

Please update the docs so that they're easy to understand and implement for beginners.

Hasura Auth code change

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.

v0.1 of the SDK

Should feature:

  • Project init
  • User login/logout
  • User session management (token and info)
  • Data API
  • QueryTemplate API
  • Custom API
  • Filestore API

Unused extra parameter (options) in hasura.auth.signup

@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 setUserInfo() method

Custom method to setUserInfo (as an alternative to login)

  • username
  • email
  • mobile
  • roles
  • auth_token
  • hasura_id

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.