From d9368aa69ce26dc99ce166c94a3b1ffc71b63c65 Mon Sep 17 00:00:00 2001 From: Federico Maggi Date: Tue, 11 Jun 2024 10:57:35 +0200 Subject: [PATCH] windows support for login --- CHANGELOG.md | 4 ++++ internal/authorization/browser_windows.go | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 internal/authorization/browser_windows.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c914ada..3f292760 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- login support for windows + ### Changed - update go version to 1.22.3 diff --git a/internal/authorization/browser_windows.go b/internal/authorization/browser_windows.go new file mode 100644 index 00000000..c0b37405 --- /dev/null +++ b/internal/authorization/browser_windows.go @@ -0,0 +1,23 @@ +// Copyright Mia srl +// SPDX-License-Identifier: Apache-2.0 +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package authorization + +import "os/exec" + +func openBrowser(url string) error { + cmd := exec.Command("cmd", "/c", "start", url) + return cmd.Run() +}