login
Signs the user in, suspending until they finish, cancel, or the attempt fails.
Never throws: every failure is a LineLoginResult.Failure, and backing out is LineLoginResult.Cancelled. The only exception that escapes is CancellationException, when the calling coroutine itself is cancelled.
Web (wasmJs)
In a browser this is a full-page redirect, not a dialog: when nobody is signed in, the call navigates to LINE and never resumes — the page unloads underneath it. LINE then redirects back, the app starts fresh, and configure completes the login as it initialises — at which point the result has nobody left to go to. Call resumePendingLogin at startup to receive it. Without that, the app shows its login screen again and a second press is what appears to work, because the tokens were already there.
A stored session short-circuits all of that and returns immediately. request is ignored on this platform: in LIFF the scopes belong to the LIFF app's console registration.
What cancellation does to the login already on screen differs by platform, and the difference is not one this library can paper over:
iOS stops the login process outright, which dismisses the LINE screen or the web sheet.
Android closes this library's own invisible Activity, but cannot dismiss LINE's authentication screen once it is on top. If the user then completes that login, LINE's SDK stores the token even though this call reported nothing — so a cancelled login can leave isLoggedIn true. Check it after cancelling if that matters to you.
Call it while your app is in the foreground. Android does not allow starting an Activity from the background and gives no callback when it refuses, so a background call resolves to LineLoginErrorCode.Internal after a ten-second timeout rather than suspending forever.
Concurrent calls do not queue: the second one returns LineLoginErrorCode.LoginInProgress immediately.