noauth대신 authtype 파라미터 사용

This commit is contained in:
2024-07-10 14:54:13 +09:00
parent 938f80b460
commit ec3edbd8d5
4 changed files with 16 additions and 25 deletions

View File

@ -36,7 +36,7 @@ import (
var devflag = flagx.Bool("dev", false, "")
var noauth = flagx.Bool("noauth", false, "")
var authtype = flagx.String("auth", "", "yes|no|both")
var authtype = flagx.String("auth", "on", "on|off|both")
var (
CollectionLink = gocommon.CollectionName("link")
@ -193,11 +193,11 @@ func New(ctx context.Context) (*Maingate, error) {
return nil, err
}
if *noauth && len(*authtype) == 0 {
*authtype = "no"
if len(*authtype) == 0 {
*authtype = "on"
}
if *authtype == "yes" || *authtype == "both" {
if !*noauth && (*authtype == "on" || *authtype == "both") {
if len(config.FirebaseAdminSDKCredentialFile) > 0 {
opt := option.WithCredentialsFile(config.FirebaseAdminSDKCredentialFile)
firebaseApp, err := firebase.NewApp(context.Background(), nil, opt)