Add random length and some more house-keeping

This commit is contained in:
2025-05-12 17:36:51 +03:00
parent 7096302999
commit ce5d77d32f
7 changed files with 52 additions and 34 deletions

View File

@@ -1,4 +1,5 @@
import { get, omit } from "radash";
import type { H3Event } from "h3";
const requiredScope = ["read", "activity:write", "activity:read_all"];
const hasEnoughScope = (scope: string) => {
@@ -11,7 +12,7 @@ export default defineOAuthStravaEventHandler({
config: {
scope: [requiredScope.join(",")],
},
onSuccess: async (event, auth) => {
onSuccess: async (event: H3Event, auth: any) => {
const query = getQuery(event);
const scope = get(query, "scope", "");