mirror of
				https://github.com/photoprism/photoprism.git
				synced 2025-11-01 04:32:49 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			20 lines
		
	
	
		
			353 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			353 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package api
 | |
| 
 | |
| import (
 | |
| 	"net/http"
 | |
| 	"testing"
 | |
| 
 | |
| 	"github.com/stretchr/testify/assert"
 | |
| )
 | |
| 
 | |
| func TestOAuthAuthorize(t *testing.T) {
 | |
| 	t.Run("PublicMode", func(t *testing.T) {
 | |
| 		app, router, _ := NewApiTest()
 | |
| 
 | |
| 		OAuthAuthorize(router)
 | |
| 
 | |
| 		r := PerformRequest(app, http.MethodGet, "/api/v1/oauth/authorize")
 | |
| 		assert.Equal(t, http.StatusForbidden, r.Code)
 | |
| 	})
 | |
| }
 | 
