Introduce application tokens

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2023-02-15 19:31:23 +01:00
parent 39768693c5
commit 2ee329ff7b
30 changed files with 1533 additions and 32 deletions

View File

@@ -0,0 +1,55 @@
import gql from "graphql-tag";
export const AUTH_APPLICATION = gql`
query AuthApplication($clientId: String!) {
authApplication(clientId: $clientId) {
clientId
name
website
}
}
`;
export const AUTORIZE_APPLICATION = gql`
mutation AuthorizeApplication(
$applicationClientId: String!
$redirectURI: String!
$state: String
$scope: String
) {
authorizeApplication(
clientId: $applicationClientId
redirectURI: $redirectURI
state: $state
scope: $scope
) {
code
state
}
}
`;
export const AUTH_AUTHORIZED_APPLICATIONS = gql`
query AuthAuthorizedApplications {
loggedUser {
id
authAuthorizedApplications {
id
application {
name
website
}
lastUsedAt
insertedAt
}
}
}
`;
export const REVOKED_AUTHORIZED_APPLICATION = gql`
mutation RevokeApplicationToken($appTokenId: String!) {
revokeApplicationToken(appTokenId: $appTokenId) {
id
}
}
`;