OAuth Improvements
New Features
- Added a convenient new way to access the user's current access token and/or refresh token.
import { Bitski } from 'bitski';
const bitski = new Bitski('CLIENT-ID', 'REDIRECT-URL');
// Later, after the user is logged in…
const accessToken = await bitski.getCurrentAccessToken(); // useful for verifying the user on your server
// Alternatively, get the refresh token. Can be used to refresh the access token manually when needed.
const refreshToken = await bitski.getCurrentRefreshToken();- Now you can request that we default to the "sign up" form instead of "sign in" for when logging in.
import { Bitski, LOGIN_HINT_SIGNUP } from 'bitski';
const bitski = new Bitski('CLIENT-ID', 'REDIRECT-URL');
// also works with signInRedirect() and start()
const user = await bitski.signIn({ login_hint: LOGIN_HINT_SIGNUP }); Deprecations
- Bitski.getAuthStatus() has been removed (in favor of non-promise var Bitski.authStatus)