summaryrefslogtreecommitdiffhomepage
path: root/packages/plugin
diff options
context:
space:
mode:
Diffstat (limited to 'packages/plugin')
-rw-r--r--packages/plugin/src/index.ts28
1 files changed, 18 insertions, 10 deletions
diff --git a/packages/plugin/src/index.ts b/packages/plugin/src/index.ts
index 1a6cbf124..a214af110 100644
--- a/packages/plugin/src/index.ts
+++ b/packages/plugin/src/index.ts
@@ -32,12 +32,16 @@ export interface Hooks {
| {
method: "auto"
callback(): Promise<
- | {
+ | ({
type: "success"
- refresh: string
- access: string
- expires: number
- }
+ } & (
+ | {
+ refresh: string
+ access: string
+ expires: number
+ }
+ | { key: string }
+ ))
| {
type: "failed"
}
@@ -46,12 +50,16 @@ export interface Hooks {
| {
method: "code"
callback(code: string): Promise<
- | {
+ | ({
type: "success"
- refresh: string
- access: string
- expires: number
- }
+ } & (
+ | {
+ refresh: string
+ access: string
+ expires: number
+ }
+ | { key: string }
+ ))
| {
type: "failed"
}