Skip to content

Commit 3efbcd3

Browse files
committed
[Docs] Improve GitHub Setup Instructions
1 parent 97d51c4 commit 3efbcd3

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

README.md

+22-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,25 @@ Work-in-Progress Real World Example for Swift Flow.
22

33
This project is currently driving some API changes, so it is using newer APIs than provided by the latest Swift Flow releases.
44

5-
Successful API changes will be merged into the Swift Flow projects.
5+
Successful API changes will be merged into the Swift Flow projects.
6+
7+
# GitHub Configuration Instructions
8+
9+
This demo requires you to create a GitHub API token that provides the app with access to content on GitHub.
10+
11+
Create an OAuth application on GitHub and note the **Client ID** and the **Client Secret**; also make sure to set the **Authorization callback URL** to `swiftflowgithub://success` as shown here:
12+
13+
![](RepoAssets/GitHub_OAuthSetup.png)
14+
15+
Open `Credentials.swift` and enter the **Client ID** and the **Client Secret** of your OAuth application:
16+
17+
```swift
18+
// In order to try out this demo you need to create an OAuth application on GitHub and provide
19+
// the credentials here.
20+
//
21+
// For more instructions take a look at the README.md in this git repository.
22+
//
23+
// Insert GitHub Token and Secret Here
24+
let gitHubClientId = ""
25+
let gitHubClientSecret = ""
26+
```

RepoAssets/GitHub_OAuthSetup.png

150 KB
Loading

SwiftFlowGitHubBrowser/Reducers/AuthenticationReducer.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ func authenticationReducer(state: AuthenticationState?, action: Action) -> Authe
2929

3030
func initialAuthenticationState() -> AuthenticationState {
3131
let config = OAuthConfiguration(
32-
token: gitHubToken,
33-
secret: gitHubSecret,
32+
token: gitHubClientId,
33+
secret: gitHubClientSecret,
3434
scopes: ["repo", "read:org"]
3535
)
3636

0 commit comments

Comments
 (0)