Releases: AckeeCZ/bear-auth
Releases · AckeeCZ/bear-auth
@bear-auth/core@3.0.12
Bear Auth v3.0.12
✨ The setAlarmManager returns now pause and resume to make possible to control the auto refreshment process:
import { setAlarmManager } from '@bear-auth/core';
const controlAutoRefreshTokenProcess = setAlarmManager('myInstanceId', {
async createAlarm(callback, delay) {
// create alarm, return alarm ID
},
async clearAlarm(id, callback) {
// clear alarm
},
});
// For example, you can pause / resume the auto refresh token process on network change
yourMethodForHandlingNetworkChange(async isOnline => {
if (isOnline) {
await controlAutoRefreshTokenProcess.resume();
} else {
await controlAutoRefreshTokenProcess.pause();
}
});Full Changelog: https://github.com/AckeeCZ/bear-auth/compare/@bear-auth/core@3.0.8...@bear-auth/core@3.0.12
Bear Auth v3.0.9
setAlarmManager
Optionally, you can now override the defaults setTimeout / clearTimeout methods to implement a custom timer, such as:
import { setAlarmManager } from '@bear-auth/core';
setAlarmManager('myInstanceId', {
async createAlarm(callback, delay) {
// create alarm, return alarm ID
},
async clearAlarm(id) {
// clear alarm
},
});Full Changelog: https://github.com/AckeeCZ/bear-auth/compare/@bear-auth/core@3.0.8...@bear-auth/core@3.0.9
Bear Auth v3.0.8
- 613065e ✨ Return the same promise when calling async fn multiple times
- 831e703 ♻️ Refactor state management, fix race-condition issue
- 41a11f2 ✨ Enhance
continueWhenOnlineto accept task names & usecontinueWhenOnlinein fetchAuthInfo tooimport { setContinueWhenOnline } from '@bear-auth/core'; setContinueWhenOnline('myInstance', async taskName => { // Set custom code to tell the Bear Auth when the app is online and can proceed with given task. // Optionally, you can decide based on the `taskName` ('logout', 'refreshToken', etc.) });
Full Changelog: https://github.com/AckeeCZ/bear-auth/compare/@bear-auth/core@3.0.7...@bear-auth/core@3.0.8
Bear Auth v3.0.4
- 1436adc 🔧 Switch from Bundler to NodeNext module resolution
- c270a1d ♻️ Use crypto.getRandomValues instead of randomUUID
- 39c5703 ♻️ Remove redundant package exports
Full Changelog: https://github.com/AckeeCZ/bear-auth/compare/@bear-auth/core@3.0.3...@bear-auth/core@3.0.4
Bear Auth v3.0.0
Bear Auth v2.1.8
- Fix
getAccessToken,retrieveAuthSession. - Rename argument:
create({ instanceId: 'foo' })->create({ id: 'foo' }). - Set
loglevelnull when using a custom logger (ThesetLoggermethod). - 7ed2db7 ✅ Add e2e smoke test for the core example
- 4ea8638 ✅ Add unit and intergration tests
- 01df848 ✨ Add core unit tests
- 2eeebf2 ⬆️ yarn & node
Bear Auth v2.1.6
🐛 Fix state management.
Bear Auth v2.1.5
♻️ Extend auth session validity
If retrieved session doesn't include refresh token but the access token is valid, result it as auth session.
Bear Auth v2.1.4
@bear-auth/core@2.1.1
- 🐛 Fix retrieving authenticated session (pass reference to refreshed access token to the fetch auth. info. hook).