mirror of
https://github.com/wassname/talk.git
synced 2026-09-09 11:38:08 +08:00
Fix fragments and queries
This commit is contained in:
@@ -114,7 +114,7 @@ export default async function createContext({
|
||||
pym,
|
||||
eventEmitter,
|
||||
registerClickFarAway,
|
||||
rest: new RestClient("/api"),
|
||||
rest: new RestClient("/api", tokenGetter),
|
||||
postMessage: new PostMessageService(),
|
||||
localStorage: createLocalStorage(),
|
||||
sessionStorage: createSessionStorage(),
|
||||
|
||||
@@ -23,6 +23,8 @@ export async function commit(
|
||||
} else {
|
||||
localStorage.removeItem("authToken");
|
||||
}
|
||||
// Increment auth revision to indicate a change in auth state.
|
||||
record.setValue(record.getValue("authRevision") + 1, "authRevision");
|
||||
|
||||
// Force gc to trigger.
|
||||
environment
|
||||
|
||||
@@ -6,9 +6,13 @@ import { commit as setAuthToken } from "./SetAuthTokenMutation";
|
||||
|
||||
export type SignOutMutation = () => Promise<void>;
|
||||
|
||||
export async function commit(environment: Environment, ctx: TalkContext) {
|
||||
await setAuthToken(environment, { authToken: "" }, ctx);
|
||||
export async function commit(
|
||||
environment: Environment,
|
||||
input: undefined,
|
||||
ctx: TalkContext
|
||||
) {
|
||||
await signOut(ctx.rest);
|
||||
await setAuthToken(environment, { authToken: "" }, ctx);
|
||||
}
|
||||
|
||||
export const withSignOutMutation = createMutationContainer("signOut", commit);
|
||||
|
||||
Reference in New Issue
Block a user