Skip to content

Commit

Permalink
fix: prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
kasvith committed Mar 8, 2024
1 parent 4990076 commit e77cc2c
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 21 deletions.
6 changes: 3 additions & 3 deletions src/@types/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ declare global {
renderButton: (
parent: HTMLElement,
options: GsiButtonConfiguration,
clickHandler?: () => void
clickHandler?: () => void,
) => void;
disableAutoSelect: () => void;
storeCredential: (
credential: { id: string; password: string },
callback?: () => void
callback?: () => void,
) => void;
cancel: () => void;
onGoogleLibraryLoad: () => void;
Expand All @@ -37,7 +37,7 @@ declare global {
oauth2: {
initTokenClient: (config: TokenClientConfig) => {
requestAccessToken: (
overridableClientConfig?: OverridableTokenClientConfig
overridableClientConfig?: OverridableTokenClientConfig,
) => void;
};
initCodeClient: (config: CodeClientConfig) => CodeClient;
Expand Down
20 changes: 16 additions & 4 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const { isReady: isTokenClientReady, login: loginTokenClient } = useTokenClient(
onSuccess: (resp) => console.log(resp),
onError: (resp) => console.error(resp),
prompt: "consent",
}
},
);
useOneTap({
Expand Down Expand Up @@ -138,10 +138,22 @@ body {
min-height: 100vh;
color: var(--color-text);
background: var(--color-background);
transition: color 0.5s, background-color 0.5s;
transition:
color 0.5s,
background-color 0.5s;
line-height: 1.6;
font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue",
font-family:
Inter,
-apple-system,
BlinkMacSystemFont,
"Segoe UI",
Roboto,
Oxygen,
Ubuntu,
Cantarell,
"Fira Sans",
"Droid Sans",
"Helvetica Neue",
sans-serif;
font-size: 15px;
text-rendering: optimizeLegibility;
Expand Down
2 changes: 1 addition & 1 deletion src/composables/useCodeClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export interface UseCodeClientReturn {
* @return {*} {UseCodeClientReturn}
*/
export default function useCodeClient(
options: ImplicitFlowOptions = {}
options: ImplicitFlowOptions = {},
): UseCodeClientReturn {
const { scope = "", onError, onSuccess, ...rest } = options;

Expand Down
2 changes: 1 addition & 1 deletion src/composables/useGsiScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ watch(
if (newCount > 0 && !loaded.value && !isLoading.value) {
initialize();
}
}
},
);

export type UseGsiScriptReturn = {
Expand Down
8 changes: 4 additions & 4 deletions src/composables/useOneTap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export interface UseGoogleOneTapLoginOptions {
* @memberof UseGoogleOneTapLoginOptions
*/
onPromptMomentNotification?: (
promptMomentNotification: PromptMomentNotification
promptMomentNotification: PromptMomentNotification,
) => void;

/**
Expand Down Expand Up @@ -169,7 +169,7 @@ export interface UseOneTapResult {
* @return {*} {UseOneTapResult}
*/
export default function useOneTap(
options?: UseGoogleOneTapLoginOptions
options?: UseGoogleOneTapLoginOptions,
): UseOneTapResult {
const {
disableAutomaticPrompt = false,
Expand All @@ -196,7 +196,7 @@ export default function useOneTap(
const login = () =>
isReady.value &&
window.google?.accounts.id.prompt((notification) =>
onPromptMomentNotification?.(notification)
onPromptMomentNotification?.(notification),
);

watchEffect((onCleanup) => {
Expand Down Expand Up @@ -246,7 +246,7 @@ export default function useOneTap(

if (shouldAutoLogin) {
window.google?.accounts.id.prompt((notification) =>
onPromptMomentNotification?.(notification)
onPromptMomentNotification?.(notification),
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/composables/useTokenClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export interface UseTokenClientReturn {
* @return {*} {UseTokenClientReturn}
*/
export default function useTokenClient(
options: AuthCodeFlowOptions = {}
options: AuthCodeFlowOptions = {},
): UseTokenClientReturn {
const { scope = "", onError, onSuccess, ...rest } = options;

Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ export interface GsiButtonConfiguration {
}

export type MomentListener = (
promptMomentNotification: PromptMomentNotification
promptMomentNotification: PromptMomentNotification,
) => void;

export interface RevocationResponse {
Expand Down
2 changes: 1 addition & 1 deletion src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const plugin: Plugin = {
install(app: App, options: GoogleSignInPluginOptions) {
if (!options) {
throw new Error(
toPluginError(`initialize plugin by passing an options object`)
toPluginError(`initialize plugin by passing an options object`),
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/utils/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function decodeCredential(credential: string): DecodedGoogleUser {
.atob(base64)
.split("")
.map((c) => `%${("00" + c.charCodeAt(0).toString(16)).slice(-2)}`)
.join("")
.join(""),
);
const decodedToken = JSON.parse(jsonPayload);
return {
Expand Down
8 changes: 4 additions & 4 deletions src/utils/oauth2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function hasGrantedAllScopes(
window.google?.accounts.oauth2.hasGrantedAllScopes(
tokenResponse,
firstScope,
...restScopes
...restScopes,
) || false
);
}
Expand All @@ -41,7 +41,7 @@ export function hasGrantedAnyScopes(
window.google?.accounts.oauth2.hasGrantedAnyScope(
tokenResponse,
firstScope,
...restScopes
...restScopes,
) || false
);
}
Expand Down Expand Up @@ -72,7 +72,7 @@ export type ImplicitFlowOptions = Omit<
* @return {string}
*/
export function buildCodeRequestRedirectUrl(
options: ImplicitFlowOptions
options: ImplicitFlowOptions,
): string {
const baseUrl = "https://accounts.google.com/o/oauth2/v2/auth";

Expand Down Expand Up @@ -106,7 +106,7 @@ export function buildCodeRequestRedirectUrl(
} else {
queryParams.append(
"enable_serial_consent",
`${options.enable_serial_consent}`
`${options.enable_serial_consent}`,
);
}

Expand Down

0 comments on commit e77cc2c

Please sign in to comment.