2.0.0-prerelease.7 • Published 9 months ago
auth-sl v2.0.0-prerelease.7
splinterlands-auth
Splinterlands library for authentication (backend + frontend)
modules/frontend
should be used on the frontend to generate the required datamodules/backend
should be used on the backend to verify the previously generated and then submitted data
// On the frontend
const auth = new Auth();
const result = await auth.frontend.hive(address);
if (result.status === 'success') {
if(result.flow === 'hivesigner') {
const { address, expiresIn, token } = result.data;
// call endpoint and send address, token
} else {
const {sig, ts} = result. result.data
// call endpoint and send address, sig, ts
}
}
// On the backend
// if sig & ts
const result = auth.backend.hive(address, sig, ts);
if(result.status === 'success') {
// great success!
}
// if token
const result = auth.backend.hivesigner(address, token);
if(result.status === 'success') {
// great success!
}
2.0.0-prerelease.7
9 months ago
2.0.0-prerelease.6
1 year ago
2.0.0-prerelease.5
1 year ago
2.0.0-prerelease.4
1 year ago
2.0.0-prerelease.3
1 year ago
2.0.0-prerelease.2
1 year ago
2.0.0-prerelease.1
1 year ago