You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The terminal will then output information about how to authenticate in your web browser:
103
+
104
+
```
105
+
Started Device Code Flow login.
106
+
Use this URL to log in: https://www.twitch.tv/activate?device-code=SZPPRMFW
107
+
Use this code when prompted at the above URL: SZPPRMFW
108
+
109
+
This system will check every 5 seconds, and will expire after 30 minutes.
110
+
```
111
+
112
+
The application will then check Twitch's servers every 5 seconds to see if you have authenticated in your web browser. When it detects you have authenticated, it will output the tokens as expected:
113
+
114
+
```
115
+
2024/03/12 11:42:24 Successfully generated User Access Token.
116
+
2024/03/12 11:42:24 User Access Token: c012345asdfetc...
Copy file name to clipboardExpand all lines: internal/events/websocket/mock_server/manager.go
+6-9
Original file line number
Diff line number
Diff line change
@@ -170,23 +170,23 @@ func printWelcomeMsg() {
170
170
171
171
log.Printf(lightBlue("Started WebSocket server on %v:%v"), serverManager.ip, serverManager.port)
172
172
ifserverManager.strictMode {
173
-
log.Printf(lightBlue("--require-subscription enabled. Clients will have 10 seconds to subscribe before being disconnected."))
173
+
log.Println(lightBlue("--require-subscription enabled. Clients will have 10 seconds to subscribe before being disconnected."))
174
174
}
175
175
176
176
fmt.Println()
177
177
178
178
log.Printf(yellow("Simulate subscribing to events at: %v://%v:%v/eventsub/subscriptions"), serverManager.protocolHttp, serverManager.ip, serverManager.port)
179
-
log.Printf(yellow("POST, GET, and DELETE are supported"))
180
-
log.Printf(yellow("For more info: https://dev.twitch.tv/docs/cli/websocket-event-command/#simulate-subscribing-to-mock-eventsub"))
179
+
log.Println(yellow("POST, GET, and DELETE are supported"))
180
+
log.Println(yellow("For more info: https://dev.twitch.tv/docs/cli/websocket-event-command/#simulate-subscribing-to-mock-eventsub"))
181
181
182
182
fmt.Println()
183
183
184
-
log.Printf(lightYellow("Events can be forwarded to this server from another terminal with --transport=websocket\nExample: \"twitch event trigger channel.ban --transport=websocket\""))
184
+
log.Println(lightYellow("Events can be forwarded to this server from another terminal with --transport=websocket\nExample: \"twitch event trigger channel.ban --transport=websocket\""))
185
185
fmt.Println()
186
-
log.Printf(lightYellow("You can send to a specific client after its connected with --session\nExample: \"twitch event trigger channel.ban --transport=websocket --session=e411cc1e_a2613d4e\""))
186
+
log.Println(lightYellow("You can send to a specific client after its connected with --session\nExample: \"twitch event trigger channel.ban --transport=websocket --session=e411cc1e_a2613d4e\""))
187
187
188
188
fmt.Println()
189
-
log.Printf(lightGreen("For further usage information, please see our official documentation:\nhttps://dev.twitch.tv/docs/cli/websocket-event-command/"))
189
+
log.Println(lightGreen("For further usage information, please see our official documentation:\nhttps://dev.twitch.tv/docs/cli/websocket-event-command/"))
190
190
fmt.Println()
191
191
192
192
log.Printf(lightBlue("Connect to the WebSocket server at: ")+"%v://%v:%v/ws", serverManager.protocolWs, serverManager.ip, serverManager.port)
@@ -392,7 +392,6 @@ func subscriptionPageHandlerPost(w http.ResponseWriter, r *http.Request) {
msg:=fmt.Sprintf("Error executing remote triggered EventSub: No clients with the subscribed to [%v / %v]", eventObj.Subscription.Type, eventObj.Subscription.Version)
513
+
msg:=fmt.Sprintf("Error executing remote triggered EventSub: No clients are subscribed to [%v / %v]", eventObj.Subscription.Type, eventObj.Subscription.Version)
// If 400 is returned, the applications' Client Type was set up as "Public", and you can only use Implicit Auth or Device Code Flow to get a User Access Token
179
+
returnLoginResponse{}, fmt.Errorf(
180
+
"This Client Type of this Client ID is set to \"Public\", which doesn't allow the use of Authorization Code Grant Flow.\n"+
181
+
"Please call the token command with the --dcf flag to use Device Code Flow. For example: twitch token -u --dcf",
0 commit comments