mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 12:56:05 +00:00
improved nextjs/remix adapters and docs, confirmed remix ssr working
This commit is contained in:
@@ -5,17 +5,19 @@ import { omit } from "lodash-es";
|
||||
import { MediaApi } from "media/api/MediaApi";
|
||||
import { SystemApi } from "modules/SystemApi";
|
||||
|
||||
export type TApiUser = object;
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
__BKND__: {
|
||||
user?: any;
|
||||
user?: TApiUser;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export type ApiOptions = {
|
||||
host: string;
|
||||
user?: object;
|
||||
user?: TApiUser;
|
||||
token?: string;
|
||||
headers?: Headers;
|
||||
key?: string;
|
||||
@@ -24,7 +26,7 @@ export type ApiOptions = {
|
||||
|
||||
export class Api {
|
||||
private token?: string;
|
||||
private user?: object;
|
||||
private user?: TApiUser;
|
||||
private verified = false;
|
||||
private token_transport: "header" | "cookie" | "none" = "header";
|
||||
|
||||
@@ -111,6 +113,10 @@ export class Api {
|
||||
};
|
||||
}
|
||||
|
||||
getUser(): TApiUser | null {
|
||||
return this.user || null;
|
||||
}
|
||||
|
||||
private buildApis() {
|
||||
const baseParams = {
|
||||
host: this.options.host,
|
||||
|
||||
Reference in New Issue
Block a user