views

package
v0.0.0-...-f52735e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

View functions for OAUTH

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Views

type Views struct {
	// contains filtered or unexported fields
}

func New

func New(cxt *base.Context) *Views

func (*Views) Logout

func (v *Views) Logout(c web.C, w http.ResponseWriter, r *http.Request)

Logout deletes the current session

Add a 'next' url parameter to control where the user is redirected to after logout.

func (*Views) OauthCallback

func (v *Views) OauthCallback(c web.C, w http.ResponseWriter, r *http.Request)

When the OAUTH service is done it redirects the user to this view with a temporary code that it can exchange for an OAUTH token. It then calls the provider to get identifying information for the user.

func (*Views) StartLogin

func (v *Views) StartLogin(c web.C, w http.ResponseWriter, r *http.Request)

StartLogin kicks off the OAUTH process.

Add a 'next' url parameter to control where the user is redirected to after a successful login.

func (*Views) StartLoginURL

func (v *Views) StartLoginURL(c web.C, w http.ResponseWriter, r *http.Request, providerName string) string

StartLoginURL returns the URL to redirect to to start the OAUTH process. It also alters the session to hold login info, and updates cookies on the response. This is used when you need to redirect to the OAUTH URL via "unconventional" means - as for Shopify embedded apps

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL