Class

pdi.jwt.JwtPlayImplicits

RichResult

Related Doc: package JwtPlayImplicits

Permalink

implicit class RichResult extends AnyRef

By adding import pdi.jwt._, you will implicitely add all those methods to Result allowing you to easily manipulate the JwtSession inside your Play application.

package controllers

import play.api._
import play.api.mvc._
import pdi.jwt._

object Application extends Controller {
  def login = Action { implicit request =>
    Ok.addingToJwtSession(("logged", true))
  }

  def logout = Action { implicit request =>
    Ok.withoutJwtSession
  }
}
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. RichResult
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RichResult(result: Result)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def addingToJwtSession[A](key: String, value: A)(implicit arg0: Writes[A], request: RequestHeader): Result

    Permalink

    Keep the current JwtSession and add some values in it, if a key is already defined, it will be overriden.

  5. def addingToJwtSession(values: (String, String)*)(implicit request: RequestHeader): Result

    Permalink

    Keep the current JwtSession and add some values in it, if a key is already defined, it will be overriden.

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  14. def jwtSession(implicit request: RequestHeader): JwtSession

    Permalink

    Retrieve the current JwtSession from the headers (first from the Result then from the RequestHeader), if none, create a new one.

    Retrieve the current JwtSession from the headers (first from the Result then from the RequestHeader), if none, create a new one.

    returns

    the JwtSession inside the headers or a new one

  15. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. def refreshJwtSession(implicit request: RequestHeader): Result

    Permalink

    If the Play app has a session.maxAge config, it will extend the expiration of the JwtSession by that time, if not, it will do nothing.

    If the Play app has a session.maxAge config, it will extend the expiration of the JwtSession by that time, if not, it will do nothing.

    returns

    the same Result with, eventually, a prolonged JwtSession

  19. def removingFromJwtSession(keys: String*)(implicit request: RequestHeader): Result

    Permalink

    Remove some keys from the current JwtSession

  20. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  21. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  22. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. def withJwtSession(fields: (String, JsValueWrapper)*): Result

    Permalink

    Override the current JwtSession with a new one created from a sequence of tuples

  26. def withJwtSession(session: JsObject): Result

    Permalink

    Override the current JwtSession with a new one created from a JsObject

  27. def withJwtSession(session: JwtSession): Result

    Permalink

    Override the current JwtSession with a new one

  28. def withNewJwtSession: Result

    Permalink

    Override the current JwtSession with a new empty one

  29. def withoutJwtSession: Result

    Permalink

    Remove the current JwtSession, which means removing the associated HTTP header

Inherited from AnyRef

Inherited from Any

Ungrouped