forked from decolua/9router
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathraycast.js
More file actions
24 lines (22 loc) · 795 Bytes
/
Copy pathraycast.js
File metadata and controls
24 lines (22 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { RAYCAST_CONFIG } from "../constants/oauth.js";
/**
* Raycast Pro AI — token-import OAuth provider (reverse-engineered, local use only).
* Requires a Bearer token, X-Raycast-DeviceId, and optional X-Raycast-Signature JWT
* captured from backend.raycast.com traffic (macOS Raycast app).
*/
const raycast = {
config: RAYCAST_CONFIG,
flowType: "import_token",
mapTokens: (tokens) => ({
accessToken: tokens.accessToken || tokens.access_token,
refreshToken: null,
expiresIn: tokens.expiresIn || 30 * 24 * 60 * 60,
providerSpecificData: {
deviceId: tokens.deviceId || tokens.device_id || "",
aid: tokens.aid || "",
sigSecret: tokens.sigSecret || tokens.signatureSecret || "",
authMethod: "imported",
},
}),
};
export default raycast;