Added discord login & removed discord register #128

This commit is contained in:
2022-11-20 15:53:04 +01:00
parent c7a925b997
commit bd94c42eae
13 changed files with 210 additions and 295 deletions

View File

@@ -167,6 +167,7 @@ export class AuthService {
})
});
}
discordCreateUser(code: string, state: string) {
return this.http.get<OAuthDTO>(`${this.appsettings.getApiURL()}/api/auth/discord/create-user?code=${code}&state=${state}`, {
headers: new HttpHeaders({
@@ -175,6 +176,14 @@ export class AuthService {
});
}
discordLogin(code: string, state: string): Observable<TokenDTO> {
return this.http.get<TokenDTO>(`${this.appsettings.getApiURL()}/api/auth/discord/login?code=${code}&state=${state}`, {
headers: new HttpHeaders({
'Content-Type': 'application/json'
})
});
}
// /api/auth/discord/register?code=
discordRegister(oAuthDTO: OAuthDTO) {
return this.http.post(`${this.appsettings.getApiURL()}/api/auth/discord/register`, oAuthDTO, {