AuthCrypto
Create json-based token, encrypt/decrypt token at other server
Usage Example
### Primary-Server server1.com###AuthCrypto = require "authcrypto"AuthCrypto.password = "MySercretP@ssword" HomeController = adminExampleAtServer2: userData = id: requserid username: requserid + "@server1.com" name: requsergetFullName avatar: requsergetAvatar role: requserrole || "user" token = AuthCryptoencrypt userData url = "http://server2.com/auth/crypto?redirect=/admin/example&token=" + token return resredirect url ### Slave-Server server2.com###AuthCrypto = require "authcrypto"AuthCrypto.password = "MySercretP@ssword" AdminController = : return resbadRequest err: "auth" if !requser return resjson secret:"information" AuthController = : = return id: rawDatausername fullname: rawDataname image: rawDataavatar role: if rawDatarole == 'root' then 'admin' : 'user' AuthCryptocontroller reqresUserconverter