import { AbstractAuthenticationProvider } from '@streamlayer/sdk-web-interfaces'; import { Transport } from '@streamlayer/sdk-web-api'; import { CoreStore } from '../../store/store'; import { DeepLinkContext } from '../../deepLink'; /** * An authorization service manages user access by providing login, logout, * authentication checks, and the ability to revoke access. * Subscribed to $userStore and automatically updates the auth header for the Transport. */ export declare class BypassAuth extends AbstractAuthenticationProvider { private readonly $coreStore; private readonly deepLink; private readonly transport; private readonly bypassLogin; constructor(store: CoreStore, transport: Transport, deepLink: DeepLinkContext); me: () => Promise; /** * Login user by token and schema. * On success, save the user and update the token to the Transport, UserStore and cache. * @param schema - schema created by the host app and provided to the StreamLayer SDK. * @param userKey - user token received from the host app. */ login: (schema: string, userKey: string) => Promise; isAuthenticated: () => Promise; /** * Logout user. Clears the all user data from the store. */ logout: () => void; /** * Soft logout, only clears the StreamLayer user data from the store. * Does not clear the external token. And automatically tries to re-login by external token. */ softLogout: () => void; /** * Try to re-login. * - If the user has an token, then try to login by it, by calling the me() method. * - If the user has an external token, then try to login by it, by calling the login() method. On failure, logout. * - * - If no one of the above is true, then logout. */ reLogin: ({ skipLogin }?: { skipLogin: boolean; }) => Promise | undefined; /** * Write token to the Transport and UserStore */ private saveUser; /** * Add interceptor to the Transport to handle 401 and 403 errors. * If the user is logged in (auth header is set), then make a soft logout. */ private connect; }