Skip to content

Commit

Permalink
[Stable8.5] Enable Clever AutoLogin (#9662)
Browse files Browse the repository at this point in the history
  • Loading branch information
benvillalobos authored Aug 29, 2023
1 parent fc42a9a commit 5d15dbe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion localtypings/pxtarget.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ declare namespace pxt {
cloudProviders?: pxt.Map<AppCloudProvider>;
}

type IdentityProviderId = "makecode" | "microsoft" | "google" | "github";
type IdentityProviderId = "makecode" | "microsoft" | "google" | "github" | "clever";

interface AppCloudProvider {
id: IdentityProviderId;
Expand Down
7 changes: 7 additions & 0 deletions webapp/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5590,6 +5590,13 @@ document.addEventListener("DOMContentLoaded", async () => {
}

await auth.initAsync();

// Trigger the login process if autologin is specified. Required for Clever.
const autoLogin = query["autologin"] as pxt.IdentityProviderId;
if (autoLogin) {
await auth.loginAsync(autoLogin, true);
}

cloud.init(); // depends on auth.init() and workspace.ts's top level
cloudsync.loginCheck()
parseLocalToken();
Expand Down

0 comments on commit 5d15dbe

Please sign in to comment.