Desktop OIDC: open in system browser via window.open, revert to copy-paste
The local HTTP server approach (fetch to 127.0.0.1) doesn't work in the Wails webview. Simplify: use window.open() to launch OIDC in the real browser. After authentication, the callback page at the server shows the token. User copies and pastes into the Token tab. Also fix: SetSize before app.Run() crashes with nil pointer — use WebviewWindowOptions width/height directly from restored state.
This commit is contained in:
@@ -558,20 +558,22 @@ func main() {
|
||||
|
||||
ws := loadWindowState()
|
||||
width, height := 1400, 900
|
||||
minWidth, minHeight := 1024, 700
|
||||
if ws != nil {
|
||||
width = ws.Width
|
||||
height = ws.Height
|
||||
}
|
||||
|
||||
window := app.Window.NewWithOptions(application.WebviewWindowOptions{
|
||||
Title: "Oikos",
|
||||
Width: width,
|
||||
Height: height,
|
||||
MinWidth: minWidth,
|
||||
MinHeight: minHeight,
|
||||
MinWidth: 1024,
|
||||
MinHeight: 700,
|
||||
URL: "/?desktop=1",
|
||||
})
|
||||
|
||||
if ws != nil {
|
||||
window.SetPosition(ws.X, ws.Y)
|
||||
window.SetSize(ws.Width, ws.Height)
|
||||
} else {
|
||||
window.Center()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user