mirror of
https://github.com/zoriya/Aeris.git
synced 2026-06-01 18:35:45 +00:00
Worker uses the github access token
This commit is contained in:
@@ -17,6 +17,7 @@ license-file: LICENSE
|
||||
build-type: Simple
|
||||
extra-source-files:
|
||||
README.md
|
||||
services/anilist.json
|
||||
services/discord.json
|
||||
services/github.json
|
||||
services/spotify.json
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ urlHandler Spotify (Just r) = do
|
||||
urlHandler Github (Just r) = do
|
||||
clientId <- liftIO $ envAsString "GITHUB_CLIENT_ID" ""
|
||||
throwError $ err302 { errHeaders =
|
||||
[("Location", B8.pack $ "https://github.com/login/oauth/authorize?response_type=code&client_id=" ++ clientId ++ "&redirect_uri=" ++ r)] }
|
||||
[("Location", B8.pack $ "https://github.com/login/oauth/authorize?response_type=code&scope=repo&client_id=" ++ clientId ++ "&redirect_uri=" ++ r)] }
|
||||
|
||||
servicesHandler :: AuthRes -> AppM [String]
|
||||
servicesHandler (Authenticated (User uid name slug)) = do
|
||||
|
||||
@@ -10,10 +10,11 @@ export class Github extends BaseService {
|
||||
private _github: Octokit;
|
||||
private _websocket: Webhooks;
|
||||
|
||||
constructor(_: Pipeline) {
|
||||
constructor(pipeline: Pipeline) {
|
||||
super();
|
||||
///TODO Get various credentials
|
||||
this._github = new Octokit();
|
||||
if (!("Github" in pipeline.userData))
|
||||
throw new Error("User not authenticated via github");
|
||||
this._github = new Octokit({auth: pipeline.userData["Github"].accessToken});
|
||||
this._websocket = new Webhooks({
|
||||
secret: "bidibi"
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user