add microsoft login

This commit is contained in:
Ruben Fiszel
2022-12-10 12:18:32 +01:00
parent b0baa07579
commit 97bcdc8e3d
3 changed files with 13 additions and 2 deletions

View File

@@ -16,5 +16,11 @@
"token_url": "https://oauth2.googleapis.com/token",
"userinfo_url": "https://www.googleapis.com/oauth2/v1/userinfo?alt=json",
"scopes": ["https://www.googleapis.com/auth/userinfo.email"]
},
"microsoft": {
"auth_url": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize",
"token_url": "https://login.microsoftonline.com/common/oauth2/v2.0/token",
"userinfo_url": "https://graph.microsoft.com/oidc/userinfo",
"scopes": ["openid", "profile", "email"]
}
}

View File

@@ -820,7 +820,7 @@ async fn slack_command(
}
#[allow(non_snake_case)]
#[derive(Deserialize)]
#[derive(Deserialize, Debug)]
pub struct UserInfo {
email: Option<String>,
name: Option<String>,

View File

@@ -9,7 +9,7 @@
<script lang="ts">
import { goto } from '$app/navigation'
import { page } from '$app/stores'
import { faGithub, faGitlab, faGoogle } from '@fortawesome/free-brands-svg-icons'
import { faGithub, faGitlab, faGoogle, faMicrosoft } from '@fortawesome/free-brands-svg-icons'
import { onMount } from 'svelte'
import { slide } from 'svelte/transition'
import { OauthService, UserService, WorkspaceService } from '$lib/gen'
@@ -38,6 +38,11 @@
type: 'google',
name: 'Google',
icon: faGoogle
},
{
type: 'microsoft',
name: 'Microsoft',
icon: faMicrosoft
}
] as const