forked from CringeStudios/gamja
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",
|
"no-implicit-coercion": "warn",
|
||||||
"object-shorthand": "warn",
|
"object-shorthand": "warn",
|
||||||
"curly": "warn",
|
"curly": "warn",
|
||||||
|
"camelcase": "warn",
|
||||||
"@stylistic/js/indent": ["warn", "tab"],
|
"@stylistic/js/indent": ["warn", "tab"],
|
||||||
"@stylistic/js/quotes": ["warn", "double"],
|
"@stylistic/js/quotes": ["warn", "double"],
|
||||||
"@stylistic/js/semi": "warn",
|
"@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
|
// TODO: use the state param to prevent cross-site request
|
||||||
// forgery
|
// forgery
|
||||||
let params = {
|
let params = {
|
||||||
response_type: "code",
|
"response_type": "code",
|
||||||
client_id: clientId,
|
"client_id": clientId,
|
||||||
redirect_uri: redirectUri,
|
"redirect_uri": redirectUri,
|
||||||
};
|
};
|
||||||
if (scope) {
|
if (scope) {
|
||||||
params.scope = scope;
|
params.scope = scope;
|
||||||
@ -66,12 +66,12 @@ function buildPostHeaders(clientId, clientSecret) {
|
|||||||
|
|
||||||
export async function exchangeCode({ serverMetadata, redirectUri, code, clientId, clientSecret }) {
|
export async function exchangeCode({ serverMetadata, redirectUri, code, clientId, clientSecret }) {
|
||||||
let data = {
|
let data = {
|
||||||
grant_type: "authorization_code",
|
"grant_type": "authorization_code",
|
||||||
code,
|
code,
|
||||||
redirect_uri: redirectUri,
|
"redirect_uri": redirectUri,
|
||||||
};
|
};
|
||||||
if (!clientSecret) {
|
if (!clientSecret) {
|
||||||
data.client_id = clientId;
|
data["client_id"] = clientId;
|
||||||
}
|
}
|
||||||
|
|
||||||
let resp = await fetch(serverMetadata.token_endpoint, {
|
let resp = await fetch(serverMetadata.token_endpoint, {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user