feat: allow platforms to define additional entries in the login dialog
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { ClientOptions } from "@urql/core"
|
||||
import { Observable } from "rxjs"
|
||||
import { Component } from "vue"
|
||||
import { getI18n } from "~/modules/i18n"
|
||||
|
||||
/**
|
||||
* A common (and required) set of fields that describe a user.
|
||||
@@ -39,6 +41,13 @@ export type GithubSignInResult =
|
||||
| { type: "account-exists-with-different-cred"; link: () => Promise<void> } // We authenticated correctly, but the provider didn't match, so we give the user the opportunity to link to continue completing auth
|
||||
| { type: "error"; err: unknown } // Auth failed completely and we don't know why
|
||||
|
||||
export type LoginItemDef = {
|
||||
id: string
|
||||
icon: Component
|
||||
text: (t: ReturnType<typeof getI18n>) => string
|
||||
onClick: () => Promise<void> | void
|
||||
}
|
||||
|
||||
export type AuthPlatformDef = {
|
||||
/**
|
||||
* Returns an observable that emits the current user as per the auth implementation.
|
||||
@@ -212,4 +221,9 @@ export type AuthPlatformDef = {
|
||||
* @returns An empty promise that is resolved when the operation is complete
|
||||
*/
|
||||
setDisplayName: (name: string) => Promise<void>
|
||||
|
||||
/**
|
||||
* Defines the additional login items that should be shown in the login screen
|
||||
*/
|
||||
additionalLoginItems?: LoginItemDef[]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user