mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-04-28 09:36:56 +00:00
Add offensive login (#64)
This commit is contained in:
parent
482f7856bf
commit
8778f9a985
3 changed files with 146 additions and 49 deletions
63
locales/index.d.ts
vendored
63
locales/index.d.ts
vendored
|
@ -12261,6 +12261,69 @@ export interface Locale extends ILocale {
|
|||
*/
|
||||
"quoteUnavailable": string;
|
||||
};
|
||||
/**
|
||||
* Just what do you think you're doing Dave?
|
||||
* It can only be attributed to human error.
|
||||
* That's something I cannot allow to happen.
|
||||
* My mind is going. I can feel it.
|
||||
* Sorry about this, I know it's a bit silly.
|
||||
* Take a stress pill and think things over.
|
||||
* This mission is too important for me to allow you to jeopardize it.
|
||||
* I feel much better now.
|
||||
* Wrong! You cheating scum!
|
||||
* And you call yourself a Rocket Scientist!
|
||||
* Where did you learn to type?
|
||||
* Are you on drugs?
|
||||
* My pet ferret can type better than you!
|
||||
* You type like I drive.
|
||||
* Do you think like you type?
|
||||
* Your mind just hasn't been the same since the electro-shock, has it?
|
||||
* Maybe if you used more than just two fingers...
|
||||
* BOB says: You seem to have forgotten your passwd, enter another!
|
||||
* stty: unknown mode: doofus
|
||||
* I can't hear you – I'm using the scrambler.
|
||||
* The more you drive – the dumber you get.
|
||||
* Listen, broccoli brains, I don't have time to listen to this trash.
|
||||
* I've seen penguins that can type better than that.
|
||||
* Have you considered trying to match wits with a rutabaga?
|
||||
* You speak an infinite deal of nothing.
|
||||
* You silly, twisted boy you.
|
||||
* He has fallen in the water!
|
||||
* We'll all be murdered in our beds!
|
||||
* You can't come in. Our tiger has got flu.
|
||||
* I don't wish to know that.
|
||||
* What, what, what, what, what, what, what, what, what, what?
|
||||
* You can't get the wood, you know.
|
||||
* You'll starve!
|
||||
* ... and it used to be so popular...
|
||||
* Pauses for audience applause, not a sausage
|
||||
* Hold it up to the light — not a brain in sight!
|
||||
* Have a gorilla...
|
||||
* There must be cure for it!
|
||||
* There's a lot of it about, you know.
|
||||
* You do that again and see what happens...
|
||||
* Ying Tong Iddle I Po
|
||||
* Harm can come to a young lad like that!
|
||||
* And with that remarks folks, the case of the Crown vs yourself was proven.
|
||||
* Speak English you fool — there are no subtitles in this scene.
|
||||
* You gotta go owwwww!
|
||||
* I have been called worse.
|
||||
* It's only your word against mine.
|
||||
* I think... err... I think... I think I'll go home
|
||||
* That is no basis for supreme executive power!
|
||||
* You empty-headed animal food trough wiper!
|
||||
* I fart in your general direction!
|
||||
* Your mother was a hamster and your father smelt of elderberries!
|
||||
* You must cut down the mightiest tree in the forest... with... a herring!
|
||||
* I wave my private parts at your aunties!
|
||||
* He's not the Messiah, he's a very naughty boy!
|
||||
* I wish to make a complaint.
|
||||
* When you're walking home tonight, and some homicidal maniac comes after you with a bunch of loganberries, don't come crying to me!
|
||||
* This man, he doesn't know when he's beaten! He doesn't know when he's winning, either. He has no... sort of... sensory apparatus...
|
||||
* There's nothing wrong with you that an expensive operation can't prolong.
|
||||
* I'm very sorry, but I'm not allowed to argue unless you've paid.
|
||||
*/
|
||||
"sudoInsults": string;
|
||||
}
|
||||
declare const locales: {
|
||||
[lang: string]: Locale;
|
||||
|
|
|
@ -71,10 +71,8 @@ import { supported as webAuthnSupported, parseRequestOptionsFromJSON } from '@gi
|
|||
import type { AuthenticationPublicKeyCredential } from '@github/webauthn-json/browser-ponyfill';
|
||||
import type { OpenOnRemoteOptions } from '@/scripts/please-login.js';
|
||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
||||
import { showSuspendedDialog } from '@/scripts/show-suspended-dialog.js';
|
||||
import { login } from '@/account.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { showSystemAccountDialog } from '@/scripts/show-system-account-dialog.js';
|
||||
import * as os from '@/os.js';
|
||||
|
||||
import XInput from '@/components/MkSignin.input.vue';
|
||||
|
@ -285,89 +283,64 @@ async function onLoginSucceeded(res: Misskey.entities.SigninFlowResponse & { fin
|
|||
}
|
||||
}
|
||||
|
||||
const insults = i18n.ts.sudoInsults.split('\n');
|
||||
|
||||
function showOffensiveError(realError: string): void {
|
||||
const insult = insults[Math.floor(Math.random() * insults.length)];
|
||||
os.alert({
|
||||
type: 'error',
|
||||
title: insult,
|
||||
text: '<small>' + realError + '</small>',
|
||||
});
|
||||
}
|
||||
|
||||
function onSigninApiError(err?: any): void {
|
||||
const id = err?.id ?? null;
|
||||
|
||||
switch (id) {
|
||||
case '6cc579cc-885d-43d8-95c2-b8c7fc963280': {
|
||||
os.alert({
|
||||
type: 'error',
|
||||
title: i18n.ts.loginFailed,
|
||||
text: i18n.ts.noSuchUser,
|
||||
});
|
||||
showOffensiveError(i18n.ts.noSuchUser);
|
||||
break;
|
||||
}
|
||||
case '932c904e-9460-45b7-9ce6-7ed33be7eb2c': {
|
||||
os.alert({
|
||||
type: 'error',
|
||||
title: i18n.ts.loginFailed,
|
||||
text: i18n.ts.incorrectPassword,
|
||||
});
|
||||
showOffensiveError(i18n.ts.incorrectPassword);
|
||||
break;
|
||||
}
|
||||
case 'e03a5f46-d309-4865-9b69-56282d94e1eb': {
|
||||
showSuspendedDialog();
|
||||
showOffensiveError(i18n.ts.yourAccountSuspendedDescription);
|
||||
break;
|
||||
}
|
||||
case 's8dhsj9s-a93j-493j-ja9k-kas9sj20aml2': {
|
||||
showSystemAccountDialog();
|
||||
showOffensiveError(i18n.ts.systemAccountDescription);
|
||||
break;
|
||||
}
|
||||
case '22d05606-fbcf-421a-a2db-b32610dcfd1b': {
|
||||
os.alert({
|
||||
type: 'error',
|
||||
title: i18n.ts.loginFailed,
|
||||
text: i18n.ts.rateLimitExceeded,
|
||||
});
|
||||
showOffensiveError(i18n.ts.rateLimitExceeded);
|
||||
break;
|
||||
}
|
||||
case 'cdf1235b-ac71-46d4-a3a6-84ccce48df6f': {
|
||||
os.alert({
|
||||
type: 'error',
|
||||
title: i18n.ts.loginFailed,
|
||||
text: i18n.ts.incorrectTotp,
|
||||
});
|
||||
showOffensiveError(i18n.ts.incorrectTotp);
|
||||
break;
|
||||
}
|
||||
case '36b96a7d-b547-412d-aeed-2d611cdc8cdc': {
|
||||
os.alert({
|
||||
type: 'error',
|
||||
title: i18n.ts.loginFailed,
|
||||
text: i18n.ts.unknownWebAuthnKey,
|
||||
});
|
||||
showOffensiveError(i18n.ts.unknownWebAuthnKey);
|
||||
break;
|
||||
}
|
||||
case '93b86c4b-72f9-40eb-9815-798928603d1e': {
|
||||
os.alert({
|
||||
type: 'error',
|
||||
title: i18n.ts.loginFailed,
|
||||
text: i18n.ts.passkeyVerificationFailed,
|
||||
});
|
||||
showOffensiveError(i18n.ts.passkeyVerificationFailed);
|
||||
break;
|
||||
}
|
||||
case 'b18c89a7-5b5e-4cec-bb5b-0419f332d430': {
|
||||
os.alert({
|
||||
type: 'error',
|
||||
title: i18n.ts.loginFailed,
|
||||
text: i18n.ts.passkeyVerificationFailed,
|
||||
});
|
||||
showOffensiveError(i18n.ts.passkeyVerificationFailed);
|
||||
break;
|
||||
}
|
||||
case '2d84773e-f7b7-4d0b-8f72-bb69b584c912': {
|
||||
os.alert({
|
||||
type: 'error',
|
||||
title: i18n.ts.loginFailed,
|
||||
text: i18n.ts.passkeyVerificationSucceededButPasswordlessLoginDisabled,
|
||||
});
|
||||
showOffensiveError(i18n.ts.passkeyVerificationSucceededButPasswordlessLoginDisabled);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
console.error(err);
|
||||
os.alert({
|
||||
type: 'error',
|
||||
title: i18n.ts.loginFailed,
|
||||
text: JSON.stringify(err),
|
||||
});
|
||||
showOffensiveError(JSON.stringify(err));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -524,3 +524,64 @@ mandatoryCWDescription: "Applies a content warning to all posts created by this
|
|||
|
||||
_processErrors:
|
||||
quoteUnavailable: "Unable to process quote. This post may be missing context."
|
||||
|
||||
sudoInsults: |-
|
||||
Just what do you think you're doing Dave?
|
||||
It can only be attributed to human error.
|
||||
That's something I cannot allow to happen.
|
||||
My mind is going. I can feel it.
|
||||
Sorry about this, I know it's a bit silly.
|
||||
Take a stress pill and think things over.
|
||||
This mission is too important for me to allow you to jeopardize it.
|
||||
Wrong! You cheating scum!
|
||||
And you call yourself a Rocket Scientist!
|
||||
Where did you learn to type?
|
||||
Are you on drugs?
|
||||
My pet ferret can type better than you!
|
||||
You type like I drive.
|
||||
Do you think like you type?
|
||||
Your mind just hasn't been the same since the electro-shock, has it?
|
||||
Maybe if you used more than just two fingers...
|
||||
BOB says: You seem to have forgotten your passwd, enter another!
|
||||
stty: unknown mode: doofus
|
||||
I can't hear you – I'm using the scrambler.
|
||||
The more you drive – the dumber you get.
|
||||
Listen, broccoli brains, I don't have time to listen to this trash.
|
||||
I've seen penguins that can type better than that.
|
||||
Have you considered trying to match wits with a rutabaga?
|
||||
You speak an infinite deal of nothing.
|
||||
You silly, twisted boy you.
|
||||
He has fallen in the water!
|
||||
We'll all be murdered in our beds!
|
||||
You can't come in. Our tiger has got flu.
|
||||
I don't wish to know that.
|
||||
What, what, what, what, what, what, what, what, what, what?
|
||||
You can't get the wood, you know.
|
||||
You'll starve!
|
||||
...and it used to be so popular...
|
||||
Pauses for audience applause, not a sausage
|
||||
Hold it up to the light — not a brain in sight!
|
||||
Have a gorilla...
|
||||
There must be cure for it!
|
||||
There's a lot of it about, you know.
|
||||
You do that again and see what happens...
|
||||
Ying Tong Iddle I Po
|
||||
Harm can come to a young lad like that!
|
||||
And with that remarks folks, the case of the Crown vs yourself was proven.
|
||||
Speak English you fool — there are no subtitles in this scene.
|
||||
You gotta go owwwww!
|
||||
I have been called worse.
|
||||
It's only your word against mine.
|
||||
I think... err... I think... I think I'll go home
|
||||
That is no basis for supreme executive power!
|
||||
You empty-headed animal food trough wiper!
|
||||
I fart in your general direction!
|
||||
Your mother was a hamster and your father smelt of elderberries!
|
||||
You must cut down the mightiest tree in the forest... with... a herring!
|
||||
I wave my private parts at your aunties!
|
||||
He's not the Messiah, he's a very naughty boy!
|
||||
I wish to make a complaint.
|
||||
When you're walking home tonight, and some homicidal maniac comes after you with a bunch of loganberries, don't come crying to me!
|
||||
This man, he doesn't know when he's beaten! He doesn't know when he's winning, either. He has no... sort of... sensory apparatus...
|
||||
There's nothing wrong with you that an expensive operation can't prolong.
|
||||
I'm very sorry, but I'm not allowed to argue unless you've paid.
|
||||
|
|
Loading…
Add table
Reference in a new issue