VNOI-Admin / OJ

A modern open-source online judge and contest platform system.
https://oj.vnoi.info
GNU Affero General Public License v3.0
164 stars 73 forks source link

Allow logging in by IP address #308

Open jalsol opened 1 year ago

jalsol commented 1 year ago

Description

Type of change: new feature

What

This PR allows logging into the account that is mapped with the IP address in the database.

To be more specific, this PR checks whether any Profile.ip matches the requesting IP address.

THIS PR MAY BRING BREAKING CHANGES. FURTHER TESTING IS REQUIRED.

Why

This allows a convenient login experience, especially for onsite competitions where IP addresses are controlled.

How Has This Been Tested?

Tested locally, in these cases:

Checklist

By submitting this pull request, I confirm that my contribution is made under the terms of the AGPL-3.0 License.