mirror of
https://github.com/certd/certd.git
synced 2026-05-15 04:27:31 +08:00
chore: oauth-second
This commit is contained in:
@@ -1,14 +1,23 @@
|
||||
export interface OauthProvider {
|
||||
buildLoginUrl: (params: { redirectUri: string }) => string;
|
||||
handleCallback: (params: { code: string; redirectUri: string }) => Promise<{
|
||||
accessToken: string;
|
||||
refreshToken: string;
|
||||
expiresIn: number;
|
||||
idToken: string;
|
||||
scope: string;
|
||||
tokenType: string;
|
||||
}>;
|
||||
bind: (params: {
|
||||
export type OnCallbackReq = {
|
||||
code: string;
|
||||
redirectUri: string;
|
||||
state: string;
|
||||
}
|
||||
|
||||
export type OauthToken = {
|
||||
userInfo: {
|
||||
openId: string;
|
||||
nickName: string;
|
||||
avatar: string;
|
||||
},
|
||||
token: {
|
||||
accessToken: string;
|
||||
refreshToken: string;
|
||||
expiresIn: number;
|
||||
}
|
||||
}
|
||||
|
||||
export type OnBindReq = {
|
||||
accessToken: string;
|
||||
refreshToken: string;
|
||||
expiresIn: number;
|
||||
@@ -16,9 +25,14 @@ export interface OauthProvider {
|
||||
scope: string;
|
||||
tokenType: string;
|
||||
bindInfo: any;
|
||||
}) => Promise<{
|
||||
}
|
||||
export type OnBindReply = {
|
||||
success: boolean;
|
||||
message: string;
|
||||
}>;
|
||||
|
||||
}
|
||||
|
||||
export interface IOauthProvider {
|
||||
buildLoginUrl: (params: { redirectUri: string }) => Promise<string>;
|
||||
onCallback: (params: OnCallbackReq) => Promise<OauthToken>;
|
||||
onBind: (params: OnBindReq) => Promise<OnBindReply>;
|
||||
}
|
||||
Reference in New Issue
Block a user