Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FakeFilter API doesn't check for subdomain #44

Closed
imCorfitz opened this issue Feb 22, 2023 · 1 comment
Closed

FakeFilter API doesn't check for subdomain #44

imCorfitz opened this issue Feb 22, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@imCorfitz
Copy link
Contributor

imCorfitz commented Feb 22, 2023

I use this quick helper function in my app to first check if I can validate the email using the always-updated API and then fallback to my local package:

import { isFakeEmailOnline, isFakeEmail as isFakeEmailLocal } from 'fakefilter';

export default async function isFakeEmail(email: string) {
	const onlineResponse = await isFakeEmailOnline(email);
	console.log('local:', isFakeEmailLocal(email));
	if (onlineResponse === null) {
		return !!isFakeEmailLocal(email);
	}
	console.log('response:', onlineResponse);
	return !!onlineResponse.isFakeDomain;
}

And this is the response in the console:

7:49:49 AM [vite] page reload src/lib/server/utils/isFakeEmail.ts (x4)
7:49:49 AM [vite-plugin-svelte] ssr compile done.
package files    time     avg
my-app      1   1.6ms   1.6ms
# Here I check email [email protected]
local: tpwlb.com
response: {
  retcode: 200,
  isFakeDomain: 'tpwlb.com',
  details: {
    provider: '10minutemail.com',
    firstseen: 1676090000,
    lastseen: 1676920000,
    randomSubdomain: false
  }
}
# Here I check email [email protected] <-- notice "sub" in domain
local: tpwlb.com
response: { retcode: 200, isFakeDomain: false, details: null }

The online response is correct when simply using the normal (fake) email address [email protected] but if I add a subdomain to the email address only my local response is correct.

Now - granted it doesn't affect my app, as I doubt many of these providers are using subdomains anyway, and thus they will never receive the verification email in order to gain access, but I wanted to flag this for a future update to the API.

@7c 7c added the bug Something isn't working label Feb 22, 2023
@7c
Copy link
Owner

7c commented Feb 25, 2023

#46

@7c 7c closed this as completed Feb 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants