Google 계정 로그인 연동 추가
This commit is contained in:
11
tests/google-oauth.test.js
Normal file
11
tests/google-oauth.test.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import test from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { normalizeGoogleOAuthRedirect } from '../server/utils/google-oauth.js'
|
||||
|
||||
test('Google OAuth redirect는 내부 경로만 허용한다', () => {
|
||||
assert.equal(normalizeGoogleOAuthRedirect('/settings', '/'), '/settings')
|
||||
assert.equal(normalizeGoogleOAuthRedirect('/admin?google=linked', '/'), '/admin?google=linked')
|
||||
assert.equal(normalizeGoogleOAuthRedirect('https://example.com', '/'), '/')
|
||||
assert.equal(normalizeGoogleOAuthRedirect('//example.com', '/'), '/')
|
||||
assert.equal(normalizeGoogleOAuthRedirect('/\\evil', '/'), '/')
|
||||
})
|
||||
Reference in New Issue
Block a user