mirror of
https://codeberg.org/emersion/gamja
synced 2025-03-12 15:33:47 +01:00
eslint: add lint enforcing camelCase
snake_case is needed in one place in the codebase to format URL arguments. Co-authored-by: Calvin Lee <pounce@integraldoma.in> Co-committed-by: Calvin Lee <pounce@integraldoma.in>
This commit is contained in:
parent
513cf825a5
commit
5146b0cad8
@ -34,6 +34,7 @@ export default [
|
||||
"no-implicit-coercion": "warn",
|
||||
"object-shorthand": "warn",
|
||||
"curly": "warn",
|
||||
"camelcase": "warn",
|
||||
"@stylistic/js/indent": ["warn", "tab"],
|
||||
"@stylistic/js/quotes": ["warn", "double"],
|
||||
"@stylistic/js/semi": "warn",
|
||||
|
@ -43,9 +43,9 @@ export function redirectAuthorize({ serverMetadata, clientId, redirectUri, scope
|
||||
// TODO: use the state param to prevent cross-site request
|
||||
// forgery
|
||||
let params = {
|
||||
response_type: "code",
|
||||
client_id: clientId,
|
||||
redirect_uri: redirectUri,
|
||||
"response_type": "code",
|
||||
"client_id": clientId,
|
||||
"redirect_uri": redirectUri,
|
||||
};
|
||||
if (scope) {
|
||||
params.scope = scope;
|
||||
@ -66,12 +66,12 @@ function buildPostHeaders(clientId, clientSecret) {
|
||||
|
||||
export async function exchangeCode({ serverMetadata, redirectUri, code, clientId, clientSecret }) {
|
||||
let data = {
|
||||
grant_type: "authorization_code",
|
||||
"grant_type": "authorization_code",
|
||||
code,
|
||||
redirect_uri: redirectUri,
|
||||
"redirect_uri": redirectUri,
|
||||
};
|
||||
if (!clientSecret) {
|
||||
data.client_id = clientId;
|
||||
data["client_id"] = clientId;
|
||||
}
|
||||
|
||||
let resp = await fetch(serverMetadata.token_endpoint, {
|
||||
|
Loading…
x
Reference in New Issue
Block a user