All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.quincy.auth.controller.RootController Maven / Gradle / Ivy

There is a newer version: 1.0.7
Show newest version
package com.quincy.auth.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import com.quincy.auth.annotation.LoginRequired;
import com.quincy.auth.o.DSession;
import com.quincy.auth.service.AuthorizationService;

@Controller
@RequestMapping("")
public class RootController {
	@Autowired
	private AuthorizationService authorizationService;

	@RequestMapping("")
	public String root(HttpServletRequest request) throws Exception {
		DSession session = authorizationService.getSession(request);
		String uri = session==null?"/auth/signin":"/index";
		return "redirect:"+uri;
	}

	@LoginRequired
	@GetMapping(value = "/index")
	public String index() {
		return "/index";
	}

	@GetMapping(value = "/static/**")
	public void handleStatic() {
		
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy