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

Very Serious Bug!!! Failed Oauth but return a user #1224

Open
amazement1 opened this issue Jun 15, 2022 · 0 comments
Open

Very Serious Bug!!! Failed Oauth but return a user #1224

amazement1 opened this issue Jun 15, 2022 · 0 comments
Labels

Comments

@amazement1
Copy link

amazement1 commented Jun 15, 2022

Bug report

Today I started implementing the Oauth for Apple login and found a big bug !

To Reproduce

The below code will success and return the first user of my database to the requester!

export class AccountsAppleProvider {
    async authenticate(params) {
       return null;
    }
}

Steps to reproduce the behavior, please provide code snippets or a repository.
You should add some null check before database finding

    async findUserByServiceId(serviceName, serviceId) {
    //------ You should add some null check before database query ------
        const user = await this.collection.findOne({
            [`services.${serviceName}.id`]: serviceId,
        });
        if (user) {
            user.id = user._id.toString();
        }
        return user;
    }```

@amazement1 amazement1 added the bug label Jun 15, 2022
@amazement1 amazement1 changed the title Very Serious Bug!!! Wrong user return for failed Oauth Very Serious Bug!!! Failed Oauth but return a user Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant