Move login to auth package
This commit is contained in:
parent
5f9e9778a0
commit
5190fbf218
8 changed files with 11 additions and 10 deletions
|
@ -1,3 +1,3 @@
|
|||
package io.github.wulkanowy.api.login
|
||||
package io.github.wulkanowy.api.auth
|
||||
|
||||
class AccountPermissionException internal constructor(message: String) : VulcanException(message)
|
|
@ -1,3 +1,3 @@
|
|||
package io.github.wulkanowy.api.login
|
||||
package io.github.wulkanowy.api.auth
|
||||
|
||||
class BadCredentialsException internal constructor(message: String) : VulcanException(message)
|
|
@ -1,4 +1,4 @@
|
|||
package io.github.wulkanowy.api.login
|
||||
package io.github.wulkanowy.api.auth
|
||||
|
||||
import org.jsoup.nodes.Document
|
||||
import java.net.HttpCookie
|
|
@ -1,4 +1,4 @@
|
|||
package io.github.wulkanowy.api.login
|
||||
package io.github.wulkanowy.api.auth
|
||||
|
||||
import org.jsoup.Jsoup
|
||||
import org.jsoup.nodes.Document
|
||||
|
@ -21,6 +21,7 @@ class Login(private val client: Client) {
|
|||
private val logger = LoggerFactory.getLogger(Login::class.java)
|
||||
}
|
||||
|
||||
//TODO: replace with request retry
|
||||
private var lastSuccessRequest: Date? = null
|
||||
|
||||
fun isLoggedIn(): Boolean {
|
||||
|
@ -95,7 +96,7 @@ class Login(private val client: Client) {
|
|||
val targetDoc = sendCertData(doc)
|
||||
var title = targetDoc.title()
|
||||
|
||||
if ("Working..." == title) { // on adfs login
|
||||
if ("Working..." == title) {
|
||||
logger.info("ADFS login")
|
||||
title = sendCertData(targetDoc).title()
|
||||
}
|
|
@ -1,3 +1,3 @@
|
|||
package io.github.wulkanowy.api.login
|
||||
package io.github.wulkanowy.api.auth
|
||||
|
||||
internal class LoginErrorException(message: String) : NotLoggedInErrorException(message)
|
|
@ -1,3 +1,3 @@
|
|||
package io.github.wulkanowy.api.login
|
||||
package io.github.wulkanowy.api.auth
|
||||
|
||||
open class NotLoggedInErrorException(message: String) : VulcanException(message)
|
|
@ -1,4 +1,4 @@
|
|||
package io.github.wulkanowy.api.login
|
||||
package io.github.wulkanowy.api.auth
|
||||
|
||||
open class VulcanException : Exception {
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package io.github.wulkanowy.api.interceptor
|
||||
|
||||
import io.github.wulkanowy.api.login.Client
|
||||
import io.github.wulkanowy.api.login.Login
|
||||
import io.github.wulkanowy.api.auth.Client
|
||||
import io.github.wulkanowy.api.auth.Login
|
||||
import okhttp3.*
|
||||
import okhttp3.logging.HttpLoggingInterceptor
|
||||
import org.jsoup.Jsoup
|
||||
|
|
Loading…
Reference in a new issue