Authentication

This section goes over authentication. You will be using this app to power the authentication for all your apps.

To test these out, simply open your console and try them out the functions


SDK

Your SDK should provide the following:

Script URL

Developers should be able to easily add the JavaScript from your website.

    <script src="https://js5.c0d3.com/auth.js"></script>
  

Signup Function

Auth.signup({
  username: 'songz',
  email: 'song@zheng.club',
  password: 'helpless',
  name: 'aouo oauu',
  age: 942,
  ... any key / value pairs you like ...
})
  

Login Function

Auth.login({
  username: 'songz',
  password: 'helpless',
})
  

Session Function

Auth.getSession().then( user => {
  console.log('User is', user)
})
  

Logout Function

// Logout, then get session should be empty
Auth.logout().then( user => {
  return Auth.getSession()
}).then(console.log)
  

Server

Auth Functions

Server should power all of the above functions using sessions

JWT Tokens

Allow authentication via JWT tokens