File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -116,6 +116,10 @@ func GetLoginURL(state string) string {
116116 return conf .AuthCodeURL (state )
117117}
118118
119+ func WithLoginURL (url string ) {
120+ loginURL = url
121+ }
122+
119123// Auth is the google authorization middleware. You can use them to protect a routergroup.
120124// Example:
121125//
Original file line number Diff line number Diff line change @@ -17,3 +17,13 @@ func TestSetupFromString(t *testing.T) {
1717 assert .Equal (t , conf .ClientSecret , "clientsecret" )
1818 })
1919}
20+
21+ func TestWithLoginURL (t * testing.T ) {
22+ t .Run ("should assign the login url" , func (t * testing.T ) {
23+ loginURL = ""
24+ url := "http://fake.fake"
25+ WithLoginURL (url )
26+ assert .NotEmpty (t , url )
27+ assert .Equal (t , url , loginURL )
28+ })
29+ }
You can’t perform that action at this time.
0 commit comments